Skip to content

Commit

Permalink
Merge pull request #5428 from murraystevenson/sceneViewInspectorUSDSu…
Browse files Browse the repository at this point in the history
…pport

SceneViewInspector : Support USD lights and shaders
  • Loading branch information
johnhaddon authored Aug 18, 2023
2 parents 8aa7797 + e1e076b commit 5ce96bc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
Improvements
------------

- Viewer : Added visualisation of light filters for USD lights.
- Viewer :
- Added visualisation of light filters for USD lights.
- Added support for USD lights and shaders in the floating inspector panel.
- ShaderTweaks/ShaderQuery : Added presets for USD light and surface shaders.

Fixes
Expand Down
9 changes: 7 additions & 2 deletions python/GafferSceneUI/_SceneViewInspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"dl" : "Delight",
"gl" : "OpenGL",
"osl" : "OSL",
"cycles" : "Cycles"
"cycles" : "Cycles",
"" : "USD",
};

__registeredShaderParameters = OrderedDict()
Expand Down Expand Up @@ -176,7 +177,11 @@ def __keyPress( self, gadget, event ) :
@staticmethod
def __attributeLabel( attribute ) :

prefix, name = attribute.split( ":", 1 )
prefix, _, name = attribute.partition( ":" )
if not name :
name = prefix
prefix = ""

prefix = _rendererAttributePrefixes.get( prefix, prefix )
name = " ".join( [ IECore.CamelCase.toSpaced( n ) for n in name.split( ":" ) ] )
return "{} {}".format( prefix, name )
Expand Down
8 changes: 8 additions & 0 deletions startup/GafferSceneUI/sceneViewInspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@

for p in ["base_color", "subsurface_color", "metallic", "subsurface", "subsurface_radius", "specular", "roughness", "specular_tint" ] :
GafferSceneUI._SceneViewInspector.registerShaderParameter( "cycles:surface", p )

# USD

for p in [ "intensity", "exposure", "color", "enableColorTemperature", "colorTemperature", "width", "height", "radius", "angle", "shaping:cone:angle", "shaping:cone:softness" ] :
GafferSceneUI._SceneViewInspector.registerShaderParameter( "light", p )

for p in [ "diffuseColor", "emissiveColor", "useSpecularWorkflow", "specularColor", "metallic", "roughness", "clearcoat", "clearcoatRoughness" ] :
GafferSceneUI._SceneViewInspector.registerShaderParameter( "surface", p )

0 comments on commit 5ce96bc

Please sign in to comment.