From 1fb34773ad5aa64fc199789f4c8ec40358b752b8 Mon Sep 17 00:00:00 2001 From: Alex Fuller Date: Wed, 9 Oct 2024 12:14:48 +1100 Subject: [PATCH] USDLight : Append the (Renderman) suffix to any USD Lux plugs with `ri:light:` prefix. --- Changes.md | 5 +++++ python/GafferUSDUI/USDShaderUI.py | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Changes.md b/Changes.md index f0f43aee171..6b03d1e0e4f 100644 --- a/Changes.md +++ b/Changes.md @@ -1,6 +1,11 @@ 1.4.x.x (relative to 1.4.14.0) ======= +Improvements +------------ + +- USDLight : Append the (Renderman) suffix to any USD Lux plugs with `ri:light:` prefix. + Fixes ----- diff --git a/python/GafferUSDUI/USDShaderUI.py b/python/GafferUSDUI/USDShaderUI.py index d05734650c5..08cfcb5b03d 100644 --- a/python/GafferUSDUI/USDShaderUI.py +++ b/python/GafferUSDUI/USDShaderUI.py @@ -112,11 +112,20 @@ def __layoutSection( plug ) : def __label( plug ) : + # When the Prman USD plugin is included with OpenUSD, the API + # schema for Lux lights gets applied but to match how other + # renderers label their custom plugs, we need to add the + # (Renderman) suffix to the label here. + + suffix = "" + if plug.getName().startswith( "ri:light:" ) : + suffix = " (Renderman)" + property = __primProperty( plug ) if property : - return property.GetMetadata( "displayName" ) + return property.GetMetadata( "displayName" ) + suffix - return __sdrProperty( plug ).GetLabel() or None + return __sdrProperty( plug ).GetLabel() + suffix or None def __description( plug ) :