Skip to content

Commit

Permalink
Merge pull request #5593 from johnhaddon/arnoldBrowserBookmarks
Browse files Browse the repository at this point in the history
File browser improvements
  • Loading branch information
johnhaddon authored Dec 19, 2023
2 parents b4b5458 + 5aba490 commit 494ee80
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
1.3.x.x (relative to 1.3.9.0)
=======

Improvements
------------

- ArnoldShader, ArnoldColorManager : Improved browsers for file parameters (#5592) :
- Added filtering by extension.
- Added bookmarks.
- USDLight : Added file browser for `shaping:ies:file` parameter.
- OpenColorIOContext : Added file browser for `config` plug.

API
---

- EditScopeAlgo : Added support for editing options for a specific render pass.
- ArnoldShaderUI : Added support for Gaffer filebrowser metadata in Arnold `.mtd` files. The following fields are supported, and correspond directly to the metadata documented on the PathPlugValueWidget and FileSystemPathPlugValueWidget :
- `path:leaf`
- `path:valid`
- `path:bookmarks`
- `fileSystemPath:extensions`
- `fileSystemPath:extensionsLabel`

1.3.9.0 (relative to 1.3.8.0)
=======
Expand Down
12 changes: 12 additions & 0 deletions arnoldPlugins/gaffer.mtd
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@
widget STRING "filename"
page STRING "Shape"
gaffer.layout.index INT 5
gaffer.path.leaf BOOL true
gaffer.path.valid BOOL true
gaffer.path.bookmarks STRING "iesProfile"
gaffer.fileSystemPath.extensions STRING "ies"
[attr radius]
page STRING "Shape"
gaffer.layout.index INT 6
Expand Down Expand Up @@ -1463,6 +1467,10 @@
[attr filename]
widget STRING "filename"
gaffer.layout.index INT 0
gaffer.path.valid BOOL true
gaffer.path.leaf BOOL true
gaffer.path.bookmarks STRING "texture"
gaffer.fileSystemPath.extensions STRING "tx"
[attr color_space]
gaffer.layout.index INT 1
[attr uvset]
Expand Down Expand Up @@ -3127,6 +3135,10 @@

[attr config]
widget STRING "filename"
gaffer.path.valid BOOL true
gaffer.path.leaf BOOL true
gaffer.path.bookmarks STRING "openColorIOConfig"
gaffer.fileSystemPath.extensions STRING "ocio"

[attr linear_chromaticities]
# Disable because we don't support array plugs yet
Expand Down
15 changes: 14 additions & 1 deletion python/GafferArnoldUI/ArnoldShaderUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def __translateNodeMetadata( nodeEntry ) :
"checkBox" : "GafferUI.BoolPlugValueWidget",
"popup" : "GafferUI.PresetsPlugValueWidget",
"mapper" : "GafferUI.PresetsPlugValueWidget",
"filename" : "GafferUI.PathPlugValueWidget",
"filename" : "GafferUI.FileSystemPathPlugValueWidget",
"camera" : "GafferSceneUI.ScenePathPlugValueWidget",
"null" : "",
}[widget]
Expand Down Expand Up @@ -398,6 +398,19 @@ def addActivator( activator ) :
addActivator( visibilityActivator )
__metadata[paramPath]["layout:visibilityActivator"] = visibilityActivator

# FileSystemPathPlugValueWidget metadata

for gafferKey, arnoldGetter in [
( "path:leaf", __aiMetadataGetBool ),
( "path:valid", __aiMetadataGetBool ),
( "path:bookmarks", __aiMetadataGetStr ),
( "fileSystemPath:extensions", __aiMetadataGetStr ),
( "fileSystemPath:extensionsLabel", __aiMetadataGetStr ),
] :
value = arnoldGetter( nodeEntry, paramName, "gaffer.{}".format( gafferKey.replace( ":", "." ) ) )
if value is not None :
__metadata[paramPath][gafferKey] = value

with IECoreArnold.UniverseBlock( writable = False ) :

nodeIt = arnold.AiUniverseGetNodeEntryIterator( arnold.AI_NODE_SHADER | arnold.AI_NODE_LIGHT | arnold.AI_NODE_COLOR_MANAGER | arnold.AI_NODE_DRIVER )
Expand Down
1 change: 1 addition & 0 deletions python/GafferImageUI/OpenColorIOConfigPlugUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
Gaffer.Metadata.registerValue( GafferImage.OpenColorIOConfigPlug, "config", "fileSystemPath:extensions", "ocio" )
Gaffer.Metadata.registerValue( GafferImage.OpenColorIOConfigPlug, "config", "path:leaf", True )
Gaffer.Metadata.registerValue( GafferImage.OpenColorIOConfigPlug, "config", "path:valid", True )
Gaffer.Metadata.registerValue( GafferImage.OpenColorIOConfigPlug, "config", "path:bookmarks", "openColorIOConfig" )

Gaffer.Metadata.registerValue( GafferImage.OpenColorIOConfigPlug, "workingSpace", "plugValueWidget:type", "GafferUI.PresetsPlugValueWidget" )
Gaffer.Metadata.registerValue( GafferImage.OpenColorIOConfigPlug, "workingSpace", "presetNames", GafferImageUI.OpenColorIOTransformUI.colorSpacePresetNames )
Expand Down
5 changes: 5 additions & 0 deletions python/GafferImageUI/OpenColorIOContextUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@

"plugValueWidget:type", "GafferUI.PresetsPlugValueWidget",
"presetsPlugValueWidget:allowCustom", True,
"presetsPlugValueWidget:customWidgetType", "GafferUI.FileSystemPathPlugValueWidget",
"path:leaf", True,
"path:valid", True,
"path:bookmarks", "openColorIOConfig",
"fileSystemPath:extensions", "ocio",

"preset:$OCIO", "",
"preset:ACES 1.3 - CG Config", "ocio://cg-config-v1.0.0_aces-v1.3_ocio-v2.1",
Expand Down
8 changes: 8 additions & 0 deletions python/GafferUSDUI/USDLightUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@
"label", lambda plug : " ".join( IECore.CamelCase.toSpaced( t ) for t in plug.getName().split( ":" )[1:] )
],

"parameters.shaping:ies:file.value" : [
"plugValueWidget:type", "GafferUI.FileSystemPathPlugValueWidget",
"path:bookmarks", "iesProfile",
"path:leaf", True,
"path:value", True,
"fileSystemPath:extensions", "ies",
],

"parameters.shadow:enable" : [ "layout:section", "Shadow" ],
"parameters.shadow:color" : [ "layout:section", "Shadow" ],
"parameters.shadow:distance" : [ "layout:section", "Shadow" ],
Expand Down

0 comments on commit 494ee80

Please sign in to comment.