# Hydra : updating a transform attribute in Hydra 2.0

**URL:** <https://forum.aousd.org/t/hydra-updating-a-transform-attribute-in-hydra-2-0/1045>\
**Category:** Hydra\
**Created:** [December 12, 2023, 4:12pm UTC](https://forum.aousd.org/t/hydra-updating-a-transform-attribute-in-hydra-2-0/1045 "2023-12-12T16:12:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlanier](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dlanier/32/166_2.png) [@dlanier](https://forum.aousd.org/u/dlanier)\
**Post date:** [December 12, 2023, 4:12pm UTC](https://forum.aousd.org/t/hydra-updating-a-transform-attribute-in-hydra-2-0/1045/1 "2023-12-12T16:12:22Z")

</div>

Hi,  
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 :

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

```

or

```auto
//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.  
Regards,  
David Lanier

---

<div class="post-metadata">

**Author:** ![tomc](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tomc](https://forum.aousd.org/u/tomc)\
**Post date:** [January 10, 2024, 11:38pm UTC](https://forum.aousd.org/t/hydra-updating-a-transform-attribute-in-hydra-2-0/1045/2 "2024-01-10T23:38:06Z")

</div>

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!  
Tom

---

<div class="post-metadata">

**Author:** ![dlanier](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dlanier/32/166_2.png) [@dlanier](https://forum.aousd.org/u/dlanier)\
**Post date:** [January 11, 2024, 9:01am UTC](https://forum.aousd.org/t/hydra-updating-a-transform-attribute-in-hydra-2-0/1045/3 "2024-01-11T09:01:30Z")

</div>

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 !
