Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Fixes
-----

- MenuBar : Made the main window menu extension button more visible. This button is shown when the window is not wide enough to show all menu items.
- LightUI : Fixed `nodule:type` metadata lookups. Previously these ignored metadata registered to `light:{name}:{parameterName}`.

1.7.0.0a10 (relative to 1.7.0.0a9)
==========
Expand Down
23 changes: 0 additions & 23 deletions python/GafferOSLUI/OSLLightUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,3 @@
}

)

# Defer parameter metadata lookups to the internal shader
# node.

def __parameterMetadata( plug, key ) :

node = plug.node()
return Gaffer.Metadata.value( node["__shader"]["parameters"].descendant( plug.relativeName( node["parameters"] ) ), key )

for key in [
"description",
"label",
"noduleLayout:label",
"layout:divider",
"layout:section",
"presetNames",
"presetValues",
"plugValueWidget:type",
"nodule:type",
"noduleLayout:visible",
"noduleLayout:label",
] :
Gaffer.Metadata.registerValue( GafferOSL.OSLLight, "parameters.*", key, functools.partial( __parameterMetadata, key = key ) )
1 change: 0 additions & 1 deletion python/GafferSceneUI/LightFilterUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def __parameterUserDefault( plug ) :
# for the case where they get promoted to a box
# individually.
"noduleLayout:section" : "left",
"nodule:type" : "",

},

Expand Down
10 changes: 5 additions & 5 deletions python/GafferSceneUI/LightUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ def __parameterMetadata( plug, key ) :

node = plug.node()
shader = node.getChild( "__shader" )
if shader is None :
## \todo Refactor Light base class to require the usage
# of an internal Shader node.
return None

return Gaffer.Metadata.value(
shader["type"].getValue() + ":" + shader["name"].getValue() + ":" + plug.relativeName( node["parameters"] ),
key
)

# Sensible default value for `nodule:type`, since the majority of light
# parameters do not support shader connections.
Gaffer.Metadata.registerValue( "light:*:*", "nodule:type", "" )

Gaffer.Metadata.registerNode(

GafferScene.Light,
Expand Down Expand Up @@ -148,6 +148,7 @@ def __parameterMetadata( plug, key ) :
"presetNames" : functools.partial( __parameterMetadata, key = "presetNames" ),
"presetValues" : functools.partial( __parameterMetadata, key = "presetValues" ),
"nodule:type" : functools.partial( __parameterMetadata, key = "nodule:type" ),
"noduleLayout:label" : functools.partial( __parameterMetadata, key = "noduleLayout:label" ),
"noduleLayout:visible" : functools.partial( __parameterMetadata, key = "noduleLayout:visible" ),
"labelPlugValueWidget:icon" : functools.partial( __parameterMetadata, key = "labelPlugValueWidget:icon" ),
"labelPlugValueWidget:iconToolTip" : functools.partial( __parameterMetadata, key = "labelPlugValueWidget:iconToolTip" ),
Expand All @@ -158,7 +159,6 @@ def __parameterMetadata( plug, key ) :
# for the case where they get promoted to a box
# individually.
"noduleLayout:section" : "left",
"nodule:type" : "",

},

Expand Down
Loading