Hydra : updating a transform attribute in Hydra 2.0

I have a scene index chain with a retained scene index which is creating an xform primitive with a transform matrix.
This scene index is the input of a filtering scene index which modifies the transform and then some others filtering scene indices are using this filtering scene index as an input.
When the transform is updated by some external event (e.g : a maya node is moved), I am updating the transform in the scene index and want the scene indices chain to be aware of that change.

The only way that is working so far is to remove and add again the prim from the retained scene index.
I have been trying different ways of dirtying the transform but none of them worked like :

HdDataSourceLocatorSet locators;
HdDirtyBitsTranslator::RprimDirtyBitsToLocatorSet(HdTokens->transform, HdChangeTracker::AllSceneDirtyBits, &locators);
_retainedSceneIndex->DirtyPrims( { {_parentPath, locators} } );


//Set dirty this field in the retained scene index for the parent prim
HdDataSourceLocatorSet locators = {HdDataSourceLocator(HdXformSchemaTokens->xform)};
_retainedSceneIndex->DirtyPrims( { {_parentPath, locators} } );

None of them have forced the prim’s transform to be updated in the scene indices chain.
So I am wondering, what is the correct way to set the transform dirty ?

Thank you.
David Lanier

Hi David,

I think we talked some on slack; I don’t know if you’re still having issues? For a prim “/prim” originating in _retainedSceneIndex, I’d expect that you could notify consumers of a dirty transform by using your second block: _retainedSceneIndex->DirtyPrims( { { “/prim”, HdDataSourceLocator(“xform”) } } );

Note that if you want this invalidation to propagate to a subtree, that is handled by the HdFlatteningSceneIndex, which will both do transform concatenation and invalidation propagation. So you’ll want to make sure that your dirty message comes in before the flattening scene index. Post-flattened scenes will have “resetXformStack” set to true on all of their transforms, which means that transforms are absolute and not parent-relative; this will also suppress invalidation propagation.

If you have access to the hydra scene browser, that has a utility to capture messages going between scene indices that might be able to help you debug.

Hope that helps!

Thank you Tom for your reply. We discussed a different issue actually on slack.
This one is still a problem for me, I will try what you mentionned when I can.
Thank you again for your support !