Skip to content

Commit

Permalink
LightEditor config : Add USD extension parameters for Arnold
Browse files Browse the repository at this point in the history
This involved moving the whole Arnold section below the USD one, so that the tab comes last in the tab group.
  • Loading branch information
johnhaddon committed Apr 30, 2024
1 parent 0604de4 commit 8af3111
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Improvements
- USDLight :
- Added Arnold-specific extension parameters.
- Added parameter tooltips.
- LightEditor : Added columns for Arnold-specific parameters on USD lights.

Fixes
-----
Expand Down
32 changes: 23 additions & 9 deletions startup/gui/lightEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,6 @@
# If 3Delight is available, then assume it will be used in preference to Cycles.
Gaffer.Metadata.registerValue( GafferSceneUI.LightEditor.Settings, "attribute", "userDefault", "osl:light" )

with IECore.IgnoredExceptions( ImportError ) :

import GafferArnold
# Register Light Editor sections for Arnold before the generic "Visualisation" section
import GafferArnoldUI

Gaffer.Metadata.registerValue( GafferSceneUI.LightEditor.Settings, "attribute", "preset:Arnold", "ai:light" )
# If Arnold is available, then assume it is the renderer of choice.
Gaffer.Metadata.registerValue( GafferSceneUI.LightEditor.Settings, "attribute", "userDefault", "ai:light" )

# UsdLux lights

Expand Down Expand Up @@ -138,6 +129,29 @@
GafferSceneUI.LightEditor.registerParameter( "light", "shadow:falloff", "Shadow" )
GafferSceneUI.LightEditor.registerParameter( "light", "shadow:falloffGamma", "Shadow" )

# Arnold lights

with IECore.IgnoredExceptions( ImportError ) :

import GafferArnold
# Register Light Editor sections for Arnold before the generic "Visualisation" section
import GafferArnoldUI

Gaffer.Metadata.registerValue( GafferSceneUI.LightEditor.Settings, "attribute", "preset:Arnold", "ai:light" )
# If Arnold is available, then assume it is the renderer of choice.
Gaffer.Metadata.registerValue( GafferSceneUI.LightEditor.Settings, "attribute", "userDefault", "ai:light" )

# Register Arnold-specific parameters for USD lights.
for parameter in [
"aov", "samples", "volume_samples", "sss", "indirect", "volume", "cast_volumetric_shadows",
"max_bounces", "camera", "transmission", "spread", "roundness", "soft_edge", "resolution",
"portal_mode", "aov_indirect"
] :
GafferSceneUI.LightEditor.registerParameter(
"light", f"arnold:{parameter}", "Arnold",
columnName = parameter.replace( "arnold:", "" )
)

# Register generic light attributes
for attributeName in [
"gl:visualiser:scale",
Expand Down

0 comments on commit 8af3111

Please sign in to comment.