Skip to content

Commit

Permalink
Arnold USD schemas : Put light properties in main sections
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
johnhaddon committed Apr 30, 2024
1 parent 8af3111 commit 4791f47
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 59 deletions.
15 changes: 7 additions & 8 deletions startup/gui/usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
102 changes: 51 additions & 51 deletions usdSchemas/GafferArnold.usda
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
)

}
Expand All @@ -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)"
)

}
Expand All @@ -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)"
)

}
Expand All @@ -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)"
)

}
Expand All @@ -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)"
)

}
Expand All @@ -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)"
)

}

0 comments on commit 4791f47

Please sign in to comment.