From 4791f47520c9c659f9468e2feb171be23586b21e Mon Sep 17 00:00:00 2001 From: John Haddon Date: Thu, 18 Apr 2024 12:13:04 +0100 Subject: [PATCH] Arnold USD schemas : Put light properties in main sections And use a label suffix to make it clear that they are Arnold-specific. It seems like this might be preferable for users of Arnold, because the parameters are closer to hand. But it probably won't scale very well as we add schemas for other renderers. I think it might be preferable though, at least in the short term, as our first big use case is trying to replace Arnold lights in an Arnold pipeline. It feels like this could also be improved aesthetically if we used icons instead of a textual suffix. --- startup/gui/usd.py | 15 +++--- usdSchemas/GafferArnold.usda | 102 +++++++++++++++++------------------ 2 files changed, 58 insertions(+), 59 deletions(-) diff --git a/startup/gui/usd.py b/startup/gui/usd.py index 75ce1da32af..8b0de997aaf 100644 --- a/startup/gui/usd.py +++ b/startup/gui/usd.py @@ -46,12 +46,11 @@ # user-created lights to `latlong`. Gaffer.Metadata.registerValue( GafferUSD.USDLight, "parameters.texture:format", "userDefault", "latlong" ) -# Put Arnold section last. We can't do that using the schemas in GafferArnold.usda +# Put Arnold parameters last. We can't do that using the schemas in GafferArnold.usda # because they provide no control over property ordering. -Gaffer.Metadata.registerValue( GafferUSD.USDLight, "parameters.arnold:*", "layout:index", -1 ) -# Open the sub-sections of Arnold light parameters by default, so everything is -# visible as soon as you pop open the main Arnold section. -Gaffer.Metadata.registerValue( GafferUSD.USDLight, "parameters", "layout:section:Arnold.Refine:collapsed", False ) -Gaffer.Metadata.registerValue( GafferUSD.USDLight, "parameters", "layout:section:Arnold.Geometry:collapsed", False ) -Gaffer.Metadata.registerValue( GafferUSD.USDLight, "parameters", "layout:section:Arnold.Sampling:collapsed", False ) -Gaffer.Metadata.registerValue( GafferUSD.USDLight, "parameters", "layout:section:Arnold.Shadows:collapsed", False ) +for i, parameter in enumerate( [ + "aov", "aov_indirect", "portal_mode", "spread", "roundness", "soft_edge", "camera", + "transmission", "sss", "indirect", "volume", "max_bounces", "cast_volumetric_shadows", + "samples", "volume_samples", "resolution" +] ) : + Gaffer.Metadata.registerValue( GafferUSD.USDLight, f"parameters.arnold:{parameter}", "layout:index", 1000 + i ) diff --git a/usdSchemas/GafferArnold.usda b/usdSchemas/GafferArnold.usda index 4472181c9ba..fda1f500eed 100644 --- a/usdSchemas/GafferArnold.usda +++ b/usdSchemas/GafferArnold.usda @@ -46,43 +46,43 @@ class "GafferArnoldLightAPI" ( { string inputs:arnold:aov = "default" ( - displayGroup = "Arnold" - displayName = "AOV" + displayGroup = "Basic" + displayName = "AOV (Arnold)" ) int inputs:arnold:samples = 1 ( - displayGroup = "Arnold.Sampling" - displayName = "Samples" + displayGroup = "Sampling" + displayName = "Samples (Arnold)" ) int inputs:arnold:volume_samples = 2 ( - displayGroup = "Arnold.Sampling" - displayName = "Volume Samples" + displayGroup = "Sampling" + displayName = "Volume Samples (Arnold)" ) float inputs:arnold:sss = 1.0 ( - displayGroup = "Arnold.Refine" - displayName = "SSS Multiplier" + displayGroup = "Refine" + displayName = "SSS (Arnold)" ) float inputs:arnold:indirect = 1.0( - displayGroup = "Arnold.Refine" - displayName = "Indirect Multiplier" + displayGroup = "Refine" + displayName = "Indirect (Arnold)" ) float inputs:arnold:volume = 1.0 ( - displayGroup = "Arnold.Refine" - displayName = "Volume Multiplier" + displayGroup = "Refine" + displayName = "Volume (Arnold)" ) bool inputs:arnold:cast_volumetric_shadows = true ( - displayGroup = "Arnold.Shadows" - displayName = "Cast Volumetric Shadows" + displayGroup = "Shadows" + displayName = "Cast Volumetric (Arnold)" ) int inputs:arnold:max_bounces = 999 ( - displayGroup = "Arnold.Refine" - displayName = "Max Bounces" + displayGroup = "Refine" + displayName = "Max Bounces (Arnold)" ) } @@ -98,13 +98,13 @@ class "GafferArnoldCylinderLightAPI" ( { float inputs:arnold:camera = 0.0 ( - displayGroup = "Arnold.Refine" - displayName = "Camera Multiplier" + displayGroup = "Refine" + displayName = "Camera (Arnold)" ) float inputs:arnold:transmission = 0.0 ( - displayGroup = "Arnold.Refine" - displayName = "Transmission Multiplier" + displayGroup = "Refine" + displayName = "Transmission (Arnold)" ) } @@ -120,18 +120,18 @@ class "GafferArnoldDiskLightAPI" ( { float inputs:arnold:spread = 1.0 ( - displayGroup = "Arnold.Geometry" + displayGroup = "Geometry" displayName = "Spread" ) float inputs:arnold:camera = 0.0 ( - displayGroup = "Arnold.Refine" - displayName = "Camera Multiplier" + displayGroup = "Refine" + displayName = "Camera (Arnold)" ) float inputs:arnold:transmission = 0.0 ( - displayGroup = "Arnold.Refine" - displayName = "Transmission Multiplier" + displayGroup = "Refine" + displayName = "Transmission (Arnold)" ) } @@ -147,13 +147,13 @@ class "GafferArnoldPointLightAPI" ( { float inputs:arnold:camera = 0.0 ( - displayGroup = "Arnold.Refine" - displayName = "Camera Multiplier" + displayGroup = "Refine" + displayName = "Camera (Arnold)" ) float inputs:arnold:transmission = 0.0 ( - displayGroup = "Arnold.Refine" - displayName = "Transmission Multiplier" + displayGroup = "Refine" + displayName = "Transmission (Arnold)" ) } @@ -169,33 +169,33 @@ class "GafferArnoldQuadLightAPI" ( { float inputs:arnold:roundness = 0.0 ( - displayGroup = "Arnold.Geometry" - displayName = "Roundness" + displayGroup = "Geometry" + displayName = "Roundness (Arnold)" ) float inputs:arnold:soft_edge = 0.0 ( - displayGroup = "Arnold.Geometry" - displayName = "Soft Edge" + displayGroup = "Geometry" + displayName = "Soft Edge (Arnold)" ) float inputs:arnold:spread = 1.0 ( - displayGroup = "Arnold.Geometry" - displayName = "Spread" + displayGroup = "Geometry" + displayName = "Spread (Arnold)" ) int inputs:arnold:resolution = 512 ( - displayGroup = "Arnold.Sampling" - displayName = "Resolution" + displayGroup = "Sampling" + displayName = "Resolution (Arnold)" ) float inputs:arnold:camera = 0.0 ( - displayGroup = "Arnold.Refine" - displayName = "Camera Multiplier" + displayGroup = "Refine" + displayName = "Camera (Arnold)" ) float inputs:arnold:transmission = 0.0 ( - displayGroup = "Arnold.Refine" - displayName = "Transmission Multiplier" + displayGroup = "Refine" + displayName = "Transmission (Arnold)" ) } @@ -212,28 +212,28 @@ class "GafferArnoldSkydomeLightAPI" ( token inputs:arnold:portal_mode = "interior_only" ( allowedTokens = [ "off", "interior_only", "interior_exterior" ] - displayGroup = "Arnold" - displayName = "Portal Mode" + displayGroup = "Basic" + displayName = "Portal Mode (Arnold)" ) bool inputs:arnold:aov_indirect = false ( - displayGroup = "Arnold" - displayName = "AOV Indirect" + displayGroup = "Basic" + displayName = "AOV Indirect (Arnold)" ) int inputs:arnold:resolution = 1000 ( - displayGroup = "Arnold.Sampling" - displayName = "Resolution" + displayGroup = "Sampling" + displayName = "Resolution (Arnold)" ) float inputs:arnold:camera = 1.0 ( - displayGroup = "Arnold.Refine" - displayName = "Camera Multiplier" + displayGroup = "Refine" + displayName = "Camera (Arnold)" ) float inputs:arnold:transmission = 1.0 ( - displayGroup = "Arnold.Refine" - displayName = "Transmission Multiplier" + displayGroup = "Refine" + displayName = "Transmission (Arnold)" ) }