@@ -1510,13 +1510,9 @@ nonstd::expected<T, std::string> EnumHandler(
1510
1510
1511
1511
} // namespace
1512
1512
1513
- // Work around until https://github.com/syoyo/tinyusdz/issues/154
1514
- // clear table to allow the latter attribute can overwrite previous definition.
1515
1513
#define PARSE_TYPED_ATTRIBUTE (__table, __prop, __name, __klass, __target ) { \
1516
1514
ParseResult ret = ParseTypedAttribute (__table, __prop.first , __prop.second , __name, __target); \
1517
1515
if (ret.code == ParseResult::ResultCode::Success || ret.code == ParseResult::ResultCode::AlreadyProcessed) { \
1518
- /* FIXME: workaround. clear table */ \
1519
- __table.erase (__name); \
1520
1516
continue ; /* got it */ \
1521
1517
} else if (ret.code == ParseResult::ResultCode::Unmatched) { \
1522
1518
/* go next */ \
@@ -1864,17 +1860,18 @@ bool ParseTimeSampledEnumProperty(
1864
1860
if (__table.count (__name)) { continue ; } \
1865
1861
if ((__prop.second .value_type_name () == value::TypeTraits<value::token>::type_name ()) && __prop.second .is_attribute () && __prop.second .is_empty ()) { \
1866
1862
PUSH_WARN (" No value assigned to `" << __name << " ` token attribute. Set default token value." ); \
1867
- /* TODO: attr meta __target.meta = attr.meta; */ \
1863
+ __target.metas () = __prop. second . get_attribute (). metas (); \
1868
1864
__table.insert (__name); \
1865
+ continue ; \
1869
1866
} else { \
1870
1867
const Attribute &attr = __prop.second .get_attribute (); \
1871
1868
std::function<nonstd::expected<__enum_ty, std::string>(const std::string &)> fun = __enum_handler; \
1872
1869
if (!ParseUniformEnumProperty (__name, __strict_check, fun, attr, &__target, warn, err)) { \
1873
1870
return false ; \
1874
1871
} \
1875
- /* copy metas */ \
1876
1872
__target.metas () = attr.metas (); \
1877
- __table.insert (__name); \
1873
+ __table.insert (__name); \
1874
+ continue ; \
1878
1875
} \
1879
1876
} \
1880
1877
}
@@ -1885,17 +1882,19 @@ bool ParseTimeSampledEnumProperty(
1885
1882
if (__table.count (__name)) { continue ; } \
1886
1883
if ((__prop.second .value_type_name () == value::TypeTraits<value::token>::type_name ()) && __prop.second .is_attribute () && __prop.second .is_empty ()) { \
1887
1884
PUSH_WARN (" No value assigned to `" << __name << " ` token attribute. Set default token value." ); \
1888
- /* TODO: attr meta __target.meta = attr.meta; */ \
1885
+ const Attribute &attr = __prop.second .get_attribute (); \
1886
+ __target.metas () = attr.metas (); \
1889
1887
__table.insert (__name); \
1888
+ continue ; \
1890
1889
} else { \
1891
1890
const Attribute &attr = __prop.second .get_attribute (); \
1892
1891
std::function<nonstd::expected<__enum_ty, std::string>(const std::string &)> fun = __enum_handler; \
1893
1892
if (!ParseTimeSampledEnumProperty (__name, __strict_check, fun, attr, &__target, warn, err)) { \
1894
1893
return false ; \
1895
1894
} \
1896
- /* copy metas */ \
1897
1895
__target.metas () = attr.metas (); \
1898
1896
__table.insert (__name); \
1897
+ continue ; \
1899
1898
} \
1900
1899
} \
1901
1900
}
0 commit comments