Frame number resolving scene index, with test. - #491
Conversation
There was a problem hiding this comment.
Not directly related to this change, but useful for debugging.
| std::unique_ptr<PXR_NS::HdxTaskController> _taskController; | ||
| PXR_NS::HdPluginRenderDelegateUniqueHandle _renderDelegate = nullptr; | ||
| PXR_NS::HdSceneIndexBaseRefPtr _lastFilteringSceneIndexBeforeCustomFiltering {nullptr}; | ||
| PXR_NS::HdSceneIndexBaseRefPtr _inputSceneIndexOfFilteringSceneIndicesChain {nullptr}; |
There was a problem hiding this comment.
Unnecessary data member, removed.
|
|
||
| void _SetRenderPurposeTags(const PXR_NS::MayaHydraParams& delegateParams); | ||
| void _CreateSceneIndicesChainAfterMergingSceneIndex(); | ||
| void _CreateSceneIndicesChainAfterMergingSceneIndex( |
There was a problem hiding this comment.
Change interface to pass in the appropriate scene index, rather than reading it from a data member.
There was a problem hiding this comment.
Adapted from AnimCubeRenderSettings.ma
There was a problem hiding this comment.
Adapted from AnimCubeRenderSettings.usda
| { | ||
| HdSceneIndexPrim prim = GetInputSceneIndex()->GetPrim(primPath); | ||
|
|
||
| auto sceneGlobals = HdSceneGlobalsSchema::GetFromSceneIndex( |
There was a problem hiding this comment.
If we have no scene globals to get time from, can't do anything.
| auto activeRenderSettingsDs = sceneGlobals.GetActiveRenderSettingsPrim(); | ||
| if (!activeRenderSettingsDs | ||
| || activeRenderSettingsDs->GetTypedValue(0) != primPath) { | ||
| return prim; |
There was a problem hiding this comment.
At this point USD render products have been flattened into data sources in the render settings prims. If this prim is not the active render settings prim, nothing to do, pass through.
| return prim; | ||
| } | ||
|
|
||
| auto renderProductsDs = HdVectorDataSource::Cast( |
There was a problem hiding this comment.
Get the render products in the Hydra flattened render settings prim.
| HdRenderSettingsSchemaTokens->renderSettings, | ||
| HdRenderSettingsSchemaTokens->renderProducts); | ||
|
|
||
| prim.dataSource = HdContainerDataSourceEditor(prim.dataSource) |
There was a problem hiding this comment.
Resolve all render products for frame number.
| // (but n is usually small), and requires the FrameNbResolvingSceneIndex to | ||
| // be downstream of the scene globals scene index. | ||
| // | ||
| HdSceneIndexObserver::DirtiedPrimEntries augmented(entries); |
There was a problem hiding this comment.
Did the time change in the scene globals? If so, dirty the render products in the active render settings prim. This might dirty too much, if the render products are not animated (default value) and have no '#' sequences (but that is not a very interesting use case), or if the render products are animated (time sampled) and have no '#' sequences. This is plausible, but we are not dirtying much, so the simplicity of this approach is worth it.
Provides support for authoring the USD RenderProduct.productName property with one or more sequences of hash marks ('#'). These hash mark sequences will be replaced with the current frame number at render time by a new frame resolving scene index.