You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the HierarchyModel does not provide a way to search for a prim path in the active stage. While there is a GetIndexForPath method, this only looks at the current state of the hierarchy cache, without populating it any further.
We have an internal need to be able to look up a path's index (if present) without knowing whether the path's parent already exists in the hierarchy cache, and I think it makes sense to add this to the model as a first-class feature. This can currently be done semi-manually by recursing through the path's prefixes and calling HierarchyModel.index() for each child row, but I would like to implement this on the HierarchyModel in a more efficient way (possibly doing the leg work in the C++ _HierarchyCache class).
The text was updated successfully, but these errors were encountered:
Please correct me if I am wrong:
Iterating SdfPath prefixes is not enough, since it does not know about the order among other child prims. Therefore the row necessary for the index can not be extracted.
I wonder what the most efficient way to do this correctly would be.
SdfChildrenView? Stage traversal is depth-first so one would pretty much need to go through the whole stage. At this point the cache is not that lazy anymore.
Is there a current workaround that you can share? Our use case is pretty much a prim seleciton in a stageView that we want to communicate to the Outliner.
Iterating SdfPath prefixes is not enough, since it does not know about the order among other child prims.
I was only mentioning that in relation to the current brute-force workaround we are using internally with the HierarchyModel itself, which looks something like this:
Currently, the
HierarchyModel
does not provide a way to search for a prim path in the active stage. While there is aGetIndexForPath
method, this only looks at the current state of the hierarchy cache, without populating it any further.We have an internal need to be able to look up a path's index (if present) without knowing whether the path's parent already exists in the hierarchy cache, and I think it makes sense to add this to the model as a first-class feature. This can currently be done semi-manually by recursing through the path's prefixes and calling
HierarchyModel.index()
for each child row, but I would like to implement this on theHierarchyModel
in a more efficient way (possibly doing the leg work in the C++_HierarchyCache
class).The text was updated successfully, but these errors were encountered: