From eb7fcd14f5c9e3ad93d8ebacf399d3f952e8131a Mon Sep 17 00:00:00 2001 From: Rakesh Roopavataram Date: Tue, 23 Jul 2024 17:19:53 -0400 Subject: [PATCH] minor tweaks --- .../sceneIndex/fvpReprSelectorSceneIndex.cpp | 6 +++++- lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.h | 2 +- lib/mayaHydra/mayaPlugin/renderOverride.cpp | 9 +++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.cpp b/lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.cpp index b2a69cb72..1b75b6916 100644 --- a/lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.cpp +++ b/lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.cpp @@ -98,9 +98,13 @@ void ReprSelectorSceneIndex::SetReprType(RepSelectorType reprType, bool needsRep } const HdDataSourceLocatorSet locators{ - HdLegacyDisplayStyleSchema::GetDefaultLocator() + HdLegacyDisplayStyleSchema::GetDefaultLocator(), + HdPrimvarsSchema::GetDefaultLocator() }; _needsReprChanged = needsReprChanged; + + // Dirty notification only if required. + _DirtyAllPrims(locators); } diff --git a/lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.h b/lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.h index 4d05f7804..9f16e29c0 100644 --- a/lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.h +++ b/lib/flowViewport/sceneIndex/fvpReprSelectorSceneIndex.h @@ -47,7 +47,7 @@ class ReprSelectorSceneIndex : public PXR_NS::HdSingleInputFilteringSceneIndexBa WireframeRefined, //Refined wireframe (refined means that it supports a "refineLevel" attribute in the displayStyle to get a more refined drawing, valid range is from 0 to 8) WireframeOnSurface, //Wireframe on surface not refined WireframeOnSurfaceRefined,//Wireframe on surface refined - None, + Default, }; FVP_API diff --git a/lib/mayaHydra/mayaPlugin/renderOverride.cpp b/lib/mayaHydra/mayaPlugin/renderOverride.cpp index dfdae7a2c..e4805c1fa 100644 --- a/lib/mayaHydra/mayaPlugin/renderOverride.cpp +++ b/lib/mayaHydra/mayaPlugin/renderOverride.cpp @@ -1150,7 +1150,7 @@ void MtohRenderOverride::_CreateSceneIndicesChainAfterMergingSceneIndex(const MH _lastFilteringSceneIndexBeforeCustomFiltering = _reprSelectorSceneIndex = Fvp::ReprSelectorSceneIndex::New(_lastFilteringSceneIndexBeforeCustomFiltering, _wireframeColorInterfaceImp); - _reprSelectorSceneIndex->SetReprType(Fvp::ReprSelectorSceneIndex::RepSelectorType::None,false); + _reprSelectorSceneIndex->SetReprType(Fvp::ReprSelectorSceneIndex::RepSelectorType::Default, false); auto wfSi = TfDynamic_cast(Fvp::WireframeSelectionHighlightSceneIndex::New(_lastFilteringSceneIndexBeforeCustomFiltering, _selection, _wireframeColorInterfaceImp)); wfSi->SetDisplayName("Flow Viewport Wireframe Selection Highlight Scene Index"); @@ -1630,11 +1630,8 @@ void MtohRenderOverride::_RenderOverrideChangedCallback( // return true if we need to recreate the filtering scene indices chain because of a change, false otherwise. bool MtohRenderOverride::_NeedToRecreateTheSceneIndicesChain(unsigned int currentDisplayStyle, bool xRayEnabled) { - if (areDifferentForOneOfTheseBits(currentDisplayStyle, _oldDisplayStyle, - MHWRender::MFrameContext::kGouraudShaded | - MHWRender::MFrameContext::kWireFrame | - MHWRender::MFrameContext::kBoundingBox ) - ){ + if (areDifferentForOneOfTheseBits(currentDisplayStyle, _oldDisplayStyle, + MHWRender::MFrameContext::kBoundingBox)){ return true; }