Skip to content

Commit

Permalink
Merge pull request #5380 from johnhaddon/arnoldOCIO
Browse files Browse the repository at this point in the history
Arnold config : Add default color manager
  • Loading branch information
johnhaddon authored Jul 11, 2023
2 parents 8e909c8 + 099f936 commit b37ce4a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Improvements
- Improved detection of no-op transforms, such as when converting between colorspace aliases like `scene_linear` and `ACEScg`.
- ColorSpace : Defaulted the input and output space to the current working space.
- DisplayTransform : Defaulted the input space to the current working space, and the display and view to the defaults defined by the current OpenColorIO config.
- ArnoldColorManager : Improved defaults to match Gaffer's current OpenColorIO configuration.
- Seeds :
- Renamed to Scatter.
- Added sampling of primitive variables from the source mesh onto the scattered points, controlled using the new `primitiveVariables` plug.
Expand Down
2 changes: 1 addition & 1 deletion python/GafferArnoldUI/ArnoldColorManagerUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __ocioConfig( plug ) :
with context :
if plug.node()["__shader"]["name"].getValue() != "color_manager_ocio" :
return None
config = plug.node()["parameters"]["config"].getValue()
config = context.substitute( plug.node()["parameters"]["config"].getValue() )
if not config :
return PyOpenColorIO.GetCurrentConfig()
else :
Expand Down
27 changes: 27 additions & 0 deletions startup/gui/ocio.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#
##########################################################################

import IECore

import Gaffer
import GafferUI
import GafferImage
Expand Down Expand Up @@ -65,3 +67,28 @@ def __scriptAdded( container, script ) :
( GafferImage.ImageWriter, "colorSpace" ),
] :
Gaffer.Metadata.registerValue( node, plug, "openColorIO:includeRoles", True )

# Set up Arnold colour manager with metadata that integrates with our OCIO configs.

with IECore.IgnoredExceptions( ImportError ) :

import GafferArnold

Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "userDefault", "${ocio:config}" )

Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "plugValueWidget:type", "GafferUI.PresetsPlugValueWidget" )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "preset:$OCIO", "" )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "preset:ACES 1.3 - CG Config", "ocio://cg-config-v1.0.0_aces-v1.3_ocio-v2.1" )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "preset:ACES 1.3 - Studio Config", "ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1" )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "preset:Legacy (Gaffer 1.2)", "${GAFFER_ROOT}/openColorIO/config.ocio" )

Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "presetsPlugValueWidget:allowCustom", True )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "presetsPlugValueWidget:customWidgetType", "GafferUI.FileSystemPathPlugValueWidget" )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "fileSystemPath:extensions", "ocio" )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "path:leaf", True )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.config", "path:valid", True )

Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.color_space_linear", "userDefault", "${ocio:workingSpace}" )
Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.color_space_linear", "preset:Working Space", "${ocio:workingSpace}" )

Gaffer.Metadata.registerValue( GafferArnold.ArnoldColorManager, "parameters.color_space_narrow", "userDefault", "matte_paint" )

0 comments on commit b37ce4a

Please sign in to comment.