Hi,
I have a retained scene index which holds a single prim (an xform prim) which has a transform and visibility attributes.
I was wondering how to set one of these attributes as dirty, so that any filtering scene index is notified of the change.
The only working way I have found so far is to remove and add again the prim again, which I think, is not the right way.
I’ve been trying to do
//Set the transform prim as dirty so it gets recomputed
HdDataSourceLocatorSet locators;
HdDirtyBitsTranslator::RprimDirtyBitsToLocatorSet(HdTokens->transform, HdChangeTracker::AllSceneDirtyBits, &locators);
_retainedSceneIndex->DirtyPrims( { {_parentPath, locators} } );
Or
//Set dirty this field in the retained scene index for the parent prim
HdDataSourceLocatorSet locators = {HdDataSourceLocator(HdXformSchemaTokens->xform)};
_retainedSceneIndex->DirtyPrims( { {_parentPath, locators} } );
But none of them triggered the Get function from the filtering scene index observing this scene index.
The way I add this primitive is by doing :
//Arrays of added prims
HdRetainedSceneIndex::AddedPrimEntries addedPrims;
HdRetainedSceneIndex::AddedPrimEntry parentPrimEntry;
parentPrimEntry.primPath = _parentPath;
parentPrimEntry.primType = HdTokens->transform;
parentPrimEntry.dataSource = HdRetainedContainerDataSource::New(
HdXformSchemaTokens->xform,
HdXformSchema::Builder().SetMatrix(HdRetainedTypedSampledDataSource<GfMatrix4d>::New(_parentMatrix)).Build(),
HdVisibilitySchemaTokens->visibility,
HdVisibilitySchema::BuildRetained(HdRetainedTypedSampledDataSource<bool>::New(true))
);
addedPrims.emplace_back(parentPrimEntry);
//Add new prims to the scene index
_retainedSceneIndex->AddPrims(addedPrims);
Thank you.
Regards,
David