Open rdeioris opened 2 weeks ago
Thanks! Let me give some time to double-check the logic of Inheritance and its implementation in TinyUSDZ.
For 'cycle detected' error case, this rule is applied:
Prims cannot inherit from an ancestor or descendant
'Base' Prim is the child of 'Test' Prim, so TinyUSDZ also should fail(and report an error)
I will summerize the logic of Inherit op and put it to wiki. Then do some tests, then merge the PR.
I have described the logic of Inherits to wki: https://github.com/lighttransport/tinyusdz/wiki/Composition-arcs#inherits
PR #210 has been merged.
Prims cannot inherit from an ancestor or descendant, inherit “bases” should be defined as siblings or outside of the target prim’s hierarchy, for example at the root level
After adding Cycle detection check of "inherits" Prim path in another PR, Inheritance management should be complete in TinyUSDZ!
Hi, the current Inheritance composition arc implementation is mostly correct. to sum up inheritance from spec:
A PrimSpec gets its props and children from another PrimSpec with the specifier "class" (this is not strictly required, but very common as classes do not appear in the final Stage). Properties and children of the inheriting PrimSpec have higher priority.
Note: the class must not be under the inheriting PrimSpec (as specified in https://remedy-entertainment.github.io/USDBook/terminology/inherits.html#inherits)
Giving the following usda:
OpenUSD usdcat returns:
While tusdcat fails as there is a bug in the caching implementation (Root3 will fail as the value is assumed to be in cache, fix will be included in the pull request).
Once the caching is fixed the output is:
Almost correct, the only missing piece is the typeName inheritance (fix in pull request).
Finally:
This is an invalid config, usdcat returns:
while tusdcat processes it (swallowing the class block)
I think tusdcat should fail too here, thoughts?