Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arnold config : Add default color manager #5380

Merged
merged 1 commit into from
Jul 11, 2023
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 @@ -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" )
Loading