diff --git a/pxr/imaging/lib/hd/renderIndex.cpp b/pxr/imaging/lib/hd/renderIndex.cpp index 45ce0a19a6..7691839c00 100644 --- a/pxr/imaging/lib/hd/renderIndex.cpp +++ b/pxr/imaging/lib/hd/renderIndex.cpp @@ -717,7 +717,7 @@ HdRenderIndex::GetRenderTag(SdfPath const& id) const { _RprimInfo const* info = TfMapLookupPtr(_rprimMap, id); if (info == nullptr) { - return HdTokens->hidden; + return HdRenderTagTokens->hidden; } return info->rprim->GetRenderTag(info->sceneDelegate); diff --git a/pxr/imaging/lib/hd/sceneDelegate.cpp b/pxr/imaging/lib/hd/sceneDelegate.cpp index c91d8c053c..a94c44c3d3 100644 --- a/pxr/imaging/lib/hd/sceneDelegate.cpp +++ b/pxr/imaging/lib/hd/sceneDelegate.cpp @@ -77,7 +77,7 @@ HdSceneDelegate::IsEnabled(TfToken const& option) const TfToken HdSceneDelegate::GetRenderTag(SdfPath const& id) { - return HdTokens->geometry; + return HdRenderTagTokens->geometry; } // -----------------------------------------------------------------------// diff --git a/pxr/imaging/lib/hd/tokens.cpp b/pxr/imaging/lib/hd/tokens.cpp index e0ae70a6a3..a0ebb6f40e 100644 --- a/pxr/imaging/lib/hd/tokens.cpp +++ b/pxr/imaging/lib/hd/tokens.cpp @@ -33,6 +33,8 @@ TF_DEFINE_PUBLIC_TOKENS(HdPerfTokens, HD_PERF_TOKENS); TF_DEFINE_PUBLIC_TOKENS(HdShaderTokens, HD_SHADER_TOKENS); +TF_DEFINE_PUBLIC_TOKENS(HdRenderTagTokens, HD_RENDERTAG_TOKENS); + TF_DEFINE_PUBLIC_TOKENS(HdMaterialTagTokens, HD_MATERIALTAG_TOKENS); TF_DEFINE_PUBLIC_TOKENS(HdOptionTokens, HD_OPTION_TOKENS); diff --git a/pxr/imaging/lib/hd/tokens.h b/pxr/imaging/lib/hd/tokens.h index 400249c2a4..bf17ada687 100644 --- a/pxr/imaging/lib/hd/tokens.h +++ b/pxr/imaging/lib/hd/tokens.h @@ -64,9 +64,7 @@ PXR_NAMESPACE_OPEN_SCOPE (faceColors) \ (full) \ (geometry) \ - (guide) \ (hermite) \ - (hidden) \ (hullIndices) \ (indices) \ (instancer) \ @@ -95,7 +93,6 @@ PXR_NAMESPACE_OPEN_SCOPE (primvar) \ (primID) \ (primitiveParam) \ - (proxy) \ (quadInfo) \ (renderTags) \ (rightHanded) \ @@ -199,6 +196,13 @@ PXR_NAMESPACE_OPEN_SCOPE #define HD_MATERIALTAG_TOKENS \ (defaultMaterialTag) +#define HD_RENDERTAG_TOKENS \ + (geometry) \ + (guide) \ + (hidden) \ + (proxy) \ + (render) + #define HD_OPTION_TOKENS \ (parallelRprimSync) @@ -322,12 +326,12 @@ TfToken HdAovTokensMakeShader(TfToken const& shader); (convergedVariance) \ (convergedSamplesPerPixel) - TF_DECLARE_PUBLIC_TOKENS(HdTokens, HD_API, HD_TOKENS); TF_DECLARE_PUBLIC_TOKENS(HdReprTokens, HD_API, HD_REPR_TOKENS); TF_DECLARE_PUBLIC_TOKENS(HdPerfTokens, HD_API, HD_PERF_TOKENS); TF_DECLARE_PUBLIC_TOKENS(HdShaderTokens, HD_API, HD_SHADER_TOKENS); TF_DECLARE_PUBLIC_TOKENS(HdMaterialTagTokens, HD_API, HD_MATERIALTAG_TOKENS); +TF_DECLARE_PUBLIC_TOKENS(HdRenderTagTokens, HD_API, HD_RENDERTAG_TOKENS); TF_DECLARE_PUBLIC_TOKENS(HdOptionTokens, HD_API, HD_OPTION_TOKENS); TF_DECLARE_PUBLIC_TOKENS(HdPrimTypeTokens, HD_API, HD_PRIMTYPE_TOKENS); TF_DECLARE_PUBLIC_TOKENS(HdPrimvarRoleTokens, HD_API, HD_PRIMVAR_ROLE_TOKENS); diff --git a/pxr/imaging/lib/hd/unitTestDelegate.cpp b/pxr/imaging/lib/hd/unitTestDelegate.cpp index 3400cb5d72..10bf705280 100644 --- a/pxr/imaging/lib/hd/unitTestDelegate.cpp +++ b/pxr/imaging/lib/hd/unitTestDelegate.cpp @@ -560,22 +560,22 @@ HdUnitTestDelegate::GetRenderTag(SdfPath const& id) HD_TRACE_FUNCTION(); if (_hiddenRprims.find(id) != _hiddenRprims.end()) { - return HdTokens->hidden; + return HdRenderTagTokens->hidden; } if (_Mesh *mesh = TfMapLookupPtr(_meshes, id)) { if (mesh->guide) { - return HdTokens->guide; + return HdRenderTagTokens->guide; } else { - return HdTokens->geometry; + return HdRenderTagTokens->geometry; } } else if (_curves.count(id) > 0) { - return HdTokens->geometry; + return HdRenderTagTokens->geometry; } else if (_points.count(id) > 0) { - return HdTokens->geometry; + return HdRenderTagTokens->geometry; } - return HdTokens->hidden; + return HdRenderTagTokens->hidden; } /*virtual*/ diff --git a/pxr/imaging/lib/hd/unitTestHelper.cpp b/pxr/imaging/lib/hd/unitTestHelper.cpp index be39520fff..f0179e289c 100644 --- a/pxr/imaging/lib/hd/unitTestHelper.cpp +++ b/pxr/imaging/lib/hd/unitTestHelper.cpp @@ -65,10 +65,10 @@ class Hd_DrawTask final : public HdTask , _renderTags() { _renderTags.reserve(2); - _renderTags.push_back(HdTokens->geometry); + _renderTags.push_back(HdRenderTagTokens->geometry); if (withGuides) { - _renderTags.push_back(HdTokens->guide); + _renderTags.push_back(HdRenderTagTokens->guide); } } diff --git a/pxr/imaging/lib/hdSt/unitTestHelper.cpp b/pxr/imaging/lib/hdSt/unitTestHelper.cpp index 5e969d45ed..d94c277e9b 100644 --- a/pxr/imaging/lib/hdSt/unitTestHelper.cpp +++ b/pxr/imaging/lib/hdSt/unitTestHelper.cpp @@ -68,10 +68,10 @@ class HdSt_DrawTask final : public HdTask , _renderTags() { _renderTags.reserve(2); - _renderTags.push_back(HdTokens->geometry); + _renderTags.push_back(HdRenderTagTokens->geometry); if (withGuides) { - _renderTags.push_back(HdTokens->guide); + _renderTags.push_back(HdRenderTagTokens->guide); } } virtual void Sync(HdSceneDelegate*, diff --git a/pxr/imaging/lib/hdx/taskController.cpp b/pxr/imaging/lib/hdx/taskController.cpp index eabbc8cc3b..0f16eea74e 100644 --- a/pxr/imaging/lib/hdx/taskController.cpp +++ b/pxr/imaging/lib/hdx/taskController.cpp @@ -288,7 +288,7 @@ HdxTaskController::_CreateRenderTask(TfToken const& materialTag) } // Create an initial set of render tags in case the user doesn't set any - TfTokenVector renderTags = { HdTokens->geometry }; + TfTokenVector renderTags = { HdRenderTagTokens->geometry }; _delegate.SetParameter(taskId, HdTokens->params, renderParams); _delegate.SetParameter(taskId, HdTokens->collection, collection); @@ -411,7 +411,7 @@ HdxTaskController::_CreateShadowTask() GetRenderIndex()->InsertTask(&_delegate, _shadowTaskId); - TfTokenVector renderTags = { HdTokens->geometry }; + TfTokenVector renderTags = { HdRenderTagTokens->geometry }; _delegate.SetParameter(_shadowTaskId, HdTokens->params, shadowParams); _delegate.SetParameter(_shadowTaskId, _tokens->renderTags, renderTags); diff --git a/pxr/imaging/lib/hdx/testenv/testHdxPickAndHighlight.cpp b/pxr/imaging/lib/hdx/testenv/testHdxPickAndHighlight.cpp index e68f780a9b..bcdf9e23b1 100644 --- a/pxr/imaging/lib/hdx/testenv/testHdxPickAndHighlight.cpp +++ b/pxr/imaging/lib/hdx/testenv/testHdxPickAndHighlight.cpp @@ -180,7 +180,8 @@ My_TestGLDrawing::InitTest() _delegate->SetTaskParam(renderSetupTask, HdTokens->params, VtValue(param)); _delegate->SetTaskParam(renderTask, HdTokens->collection, - VtValue(HdRprimCollection(HdTokens->geometry, HdReprSelector(_reprName)))); + VtValue(HdRprimCollection(HdTokens->geometry, + HdReprSelector(_reprName)))); HdxSelectionTaskParams selParam; selParam.enableSelection = true; selParam.selectionColor = GfVec4f(1, 1, 0, 1); diff --git a/pxr/imaging/lib/hdx/tokens.cpp b/pxr/imaging/lib/hdx/tokens.cpp index 70a33c969e..b890e8deae 100644 --- a/pxr/imaging/lib/hdx/tokens.cpp +++ b/pxr/imaging/lib/hdx/tokens.cpp @@ -29,7 +29,7 @@ PXR_NAMESPACE_OPEN_SCOPE TF_DEFINE_PUBLIC_TOKENS(HdxTokens, HDX_TOKENS); TF_DEFINE_PUBLIC_TOKENS(HdxPrimitiveTokens, HDX_PRIMITIVE_TOKENS); TF_DEFINE_PUBLIC_TOKENS(HdxOptionTokens, HDX_OPTION_TOKENS); -TF_DEFINE_PUBLIC_TOKENS(HdxRenderTagsTokens, HDX_RENDERTAGS_TOKENS); +TF_DEFINE_PUBLIC_TOKENS(HdxRenderTagTokens, HDX_RENDERTAG_TOKENS); TF_DEFINE_PUBLIC_TOKENS(HdxMaterialTagTokens, HDX_MATERIALTAG_TOKENS); TF_DEFINE_PUBLIC_TOKENS(HdxColorCorrectionTokens, HDX_COLOR_CORRECTION_TOKENS); diff --git a/pxr/imaging/lib/hdx/tokens.h b/pxr/imaging/lib/hdx/tokens.h index 0532aa9e7d..ebb7a9496d 100644 --- a/pxr/imaging/lib/hdx/tokens.h +++ b/pxr/imaging/lib/hdx/tokens.h @@ -91,8 +91,7 @@ TF_DECLARE_PUBLIC_TOKENS(HdxPrimitiveTokens, HDX_API, HDX_PRIMITIVE_TOKENS); TF_DECLARE_PUBLIC_TOKENS(HdxOptionTokens, HDX_API, HDX_OPTION_TOKENS); -#define HDX_RENDERTAGS_TOKENS \ - (guide) \ +#define HDX_RENDERTAG_TOKENS \ (renderingGuide) \ (label) \ (cameraGuide) \ @@ -100,7 +99,7 @@ TF_DECLARE_PUBLIC_TOKENS(HdxOptionTokens, HDX_API, HDX_OPTION_TOKENS); (interactiveOnlyGeom) \ (path) -TF_DECLARE_PUBLIC_TOKENS(HdxRenderTagsTokens, HDX_API, HDX_RENDERTAGS_TOKENS); +TF_DECLARE_PUBLIC_TOKENS(HdxRenderTagTokens, HDX_API, HDX_RENDERTAG_TOKENS); #define HDX_MATERIALTAG_TOKENS \ (additive) \ diff --git a/pxr/usdImaging/lib/usdImaging/delegate.cpp b/pxr/usdImaging/lib/usdImaging/delegate.cpp index 3db769248e..abb8357e5c 100644 --- a/pxr/usdImaging/lib/usdImaging/delegate.cpp +++ b/pxr/usdImaging/lib/usdImaging/delegate.cpp @@ -1575,11 +1575,11 @@ UsdImagingDelegate::GetRenderTag(SdfPath const& id) if (purpose == UsdGeomTokens->default_) { // Simple mapping so all render tags in multiple delegates match - purpose = HdTokens->geometry; + purpose = HdRenderTagTokens->geometry; } else if (purpose == UsdGeomTokens->guide && !_displayGuides) { // When guides are disabled on the delegate we move the // guide prims to the hidden command buffer - purpose = HdTokens->hidden; + purpose = HdRenderTagTokens->hidden; } TF_DEBUG(USDIMAGING_COLLECTIONS).Msg("GetRenderTag %s -> %s \n", diff --git a/pxr/usdImaging/lib/usdImaging/unitTestHelper.h b/pxr/usdImaging/lib/usdImaging/unitTestHelper.h index d743b4385e..603c2a764a 100644 --- a/pxr/usdImaging/lib/usdImaging/unitTestHelper.h +++ b/pxr/usdImaging/lib/usdImaging/unitTestHelper.h @@ -106,7 +106,7 @@ class UsdImaging_TestDriver final { HdReprSelector(HdReprTokens->hull)); TfTokenVector renderTags; - renderTags.push_back(HdTokens->geometry); + renderTags.push_back(HdRenderTagTokens->geometry); _Init(UsdStage::Open(usdFilePath), collection, @@ -148,7 +148,7 @@ class UsdImaging_TestDriver final { HdReprSelector(HdReprTokens->hull)); TfTokenVector renderTags; - renderTags.push_back(HdTokens->geometry); + renderTags.push_back(HdRenderTagTokens->geometry); _Init(usdStage, collection, SdfPath::AbsoluteRootPath(), renderTags); } diff --git a/pxr/usdImaging/lib/usdImagingGL/engine.cpp b/pxr/usdImaging/lib/usdImagingGL/engine.cpp index 9327129673..7406b8bccd 100644 --- a/pxr/usdImaging/lib/usdImagingGL/engine.cpp +++ b/pxr/usdImaging/lib/usdImagingGL/engine.cpp @@ -1330,15 +1330,15 @@ UsdImagingGLEngine::_ComputeRenderTags(UsdImagingGLRenderParams const& params, // the application renderTags->clear(); renderTags->reserve(4); - renderTags->push_back(HdTokens->geometry); + renderTags->push_back(HdRenderTagTokens->geometry); if (params.showGuides) { - renderTags->push_back(HdxRenderTagsTokens->guide); + renderTags->push_back(HdRenderTagTokens->guide); } if (params.showProxy) { - renderTags->push_back(UsdGeomTokens->proxy); + renderTags->push_back(HdRenderTagTokens->proxy); } if (params.showRender) { - renderTags->push_back(UsdGeomTokens->render); + renderTags->push_back(HdRenderTagTokens->render); } } diff --git a/third_party/maya/lib/pxrUsdMayaGL/batchRenderer.cpp b/third_party/maya/lib/pxrUsdMayaGL/batchRenderer.cpp index d7d112e68b..b162cb29b0 100644 --- a/third_party/maya/lib/pxrUsdMayaGL/batchRenderer.cpp +++ b/third_party/maya/lib/pxrUsdMayaGL/batchRenderer.cpp @@ -1023,7 +1023,9 @@ UsdMayaGLBatchRenderer::_GetIntersectionPrimFilters( primFilters.push_back( PxrMayaHdPrimFilter { collection, - TfTokenVector{HdTokens->geometry, HdTokens->proxy} + TfTokenVector{ + HdRenderTagTokens->geometry, + HdRenderTagTokens->proxy} }); } diff --git a/third_party/maya/lib/pxrUsdMayaGL/sceneDelegate.cpp b/third_party/maya/lib/pxrUsdMayaGL/sceneDelegate.cpp index 0026dd09bd..7374888801 100644 --- a/third_party/maya/lib/pxrUsdMayaGL/sceneDelegate.cpp +++ b/third_party/maya/lib/pxrUsdMayaGL/sceneDelegate.cpp @@ -143,10 +143,9 @@ PxrMayaHdSceneDelegate::PxrMayaHdSceneDelegate( { // By default we only want geometry in the shadow pass const TfTokenVector defaultShadowRenderTags = { - HdTokens->geometry, + HdRenderTagTokens->geometry, }; - renderIndex->InsertTask(this, _shadowTaskId); _ValueCache& cache = _valueCacheMap[_shadowTaskId]; HdxShadowTaskParams taskParams; diff --git a/third_party/maya/lib/pxrUsdMayaGL/usdProxyShapeAdapter.cpp b/third_party/maya/lib/pxrUsdMayaGL/usdProxyShapeAdapter.cpp index 60ee643d6c..2fead953d1 100644 --- a/third_party/maya/lib/pxrUsdMayaGL/usdProxyShapeAdapter.cpp +++ b/third_party/maya/lib/pxrUsdMayaGL/usdProxyShapeAdapter.cpp @@ -184,15 +184,15 @@ PxrMayaHdUsdProxyShapeAdapter::_Sync( // Update Render Tags _renderTags.clear(); - _renderTags.push_back(HdTokens->geometry); + _renderTags.push_back(HdRenderTagTokens->geometry); if (drawRenderPurpose) { - _renderTags.push_back(UsdGeomTokens->render); + _renderTags.push_back(HdRenderTagTokens->render); } if (drawProxyPurpose) { - _renderTags.push_back(HdTokens->proxy); + _renderTags.push_back(HdRenderTagTokens->proxy); } if (drawGuidePurpose) { - _renderTags.push_back(HdTokens->guide); + _renderTags.push_back(HdRenderTagTokens->guide); } MStatus status; diff --git a/third_party/renderman-22/plugin/hdPrman/testenv/testHdPrman.cpp b/third_party/renderman-22/plugin/hdPrman/testenv/testHdPrman.cpp index 15a0162e90..95cdc82254 100644 --- a/third_party/renderman-22/plugin/hdPrman/testenv/testHdPrman.cpp +++ b/third_party/renderman-22/plugin/hdPrman/testenv/testHdPrman.cpp @@ -549,7 +549,7 @@ int main(int argc, char *argv[]) hdUsdFrontend.SetTime(frameNum); hdUsdFrontend.SetRefineLevelFallback(8); // max refinement - TfTokenVector renderTags(1, HdTokens->geometry); + TfTokenVector renderTags(1, HdRenderTagTokens->geometry); // The collection of scene contents to render HdRprimCollection hdCollection(_tokens->testCollection, HdReprSelector(HdReprTokens->smoothHull));