Much like Storm and RenderMan, we’re looking at adding custom Scene Indexes for our renderers to feed the DependencyForwardingSceneIndex
with dependencies specific to our needs.
One of the dependencies we’re currently looking at, however, is not a “when X is dirty, Y should be dirty” dependency but, rather, “when X is removed, Y should be dirty”. We’ve found we can still use a HdDependencySchema
to achieve this, with:
static HdLocatorDataSourceHandle dependedOnLocatorDataSource =
HdRetainedTypedSampledDataSource<HdDataSourceLocator>::New(
HdDataSourceLocator(TfToken("__no_locator__")));
builder.SetDependedOnDataSourceLocator(dependedOnLocatorDataSource);
Since __no_locator__
doesn’t exist, we won’t generate any unnecessary dirtying, but since DependencyForwardingSceneIndex
handles prim removal and does a blanket dirtying for all registered dependencies irrespective of the locator, we do get the dirtying for deletion - what we want.
So the question is: is this a brilliant/clever/sensible (ab)use of the dependency system, or is this a terrible horrible idea and I should really really be handling this in our scene index via _PrimsRemoved
and sending a _SendPrimsDirtied
ourselves?