mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
update set_review_color_space() and get_houdini_color_settings() logic
This commit is contained in:
parent
a1d1c49e38
commit
83089da81a
2 changed files with 26 additions and 26 deletions
|
|
@ -846,25 +846,22 @@ def get_houdini_color_settings():
|
||||||
|
|
||||||
project_settings = get_current_project_settings()
|
project_settings = get_current_project_settings()
|
||||||
color_settings = project_settings["houdini"]["imageio"]["workfile"]
|
color_settings = project_settings["houdini"]["imageio"]["workfile"]
|
||||||
if color_settings["enabled"]:
|
|
||||||
color_settings.pop("enabled")
|
|
||||||
# Remove leading, and trailing whitespaces
|
|
||||||
color_settings["review_color_space"] = \
|
|
||||||
color_settings["review_color_space"].strip()
|
|
||||||
return color_settings
|
|
||||||
|
|
||||||
return {}
|
# Remove leading, and trailing whitespaces
|
||||||
|
color_settings["review_color_space"] = \
|
||||||
|
color_settings["review_color_space"].strip()
|
||||||
|
return color_settings
|
||||||
|
|
||||||
|
|
||||||
def set_review_color_space(opengl_node, log=None):
|
def set_review_color_space(opengl_node, log=None):
|
||||||
"""Set ociocolorspace parameter for the given OpenGL node.
|
"""Set ociocolorspace parameter for the given OpenGL node.
|
||||||
|
|
||||||
if workfile settings are enabled, it will use the value
|
If workfile settings are enabled, it will use the value
|
||||||
exposed in the settings.
|
exposed in the settings.
|
||||||
|
|
||||||
if workfile settings are disabled, it will use the default
|
If the value exposed in the settings is empty,
|
||||||
colorspace corresponding to the display & view of
|
it will use the default colorspace corresponding to
|
||||||
the current Houdini session.
|
the display & view of the current Houdini session.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
OpenGl node (hou.Node): ROP node to set its ociocolorspace parameter.
|
OpenGl node (hou.Node): ROP node to set its ociocolorspace parameter.
|
||||||
|
|
@ -884,8 +881,10 @@ def set_review_color_space(opengl_node, log=None):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Get view space for ociocolorspace parm.
|
# Get view space for ociocolorspace parm.
|
||||||
view_space = get_houdini_color_settings().get("review_color_space")
|
color_settings = get_houdini_color_settings()
|
||||||
|
view_space = color_settings["review_color_space"] if color_settings["enabled"] else "" # noqa
|
||||||
|
|
||||||
|
# fall to default review color space if the setting is empty.
|
||||||
if not view_space:
|
if not view_space:
|
||||||
from openpype.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa
|
from openpype.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa
|
||||||
view_space = get_default_display_view_colorspace()
|
view_space = get_default_display_view_colorspace()
|
||||||
|
|
|
||||||
|
|
@ -66,17 +66,18 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin,
|
||||||
)
|
)
|
||||||
|
|
||||||
color_settings = get_houdini_color_settings()
|
color_settings = get_houdini_color_settings()
|
||||||
if color_settings.get("override_review_color"):
|
# skip if houdini color settings are disabled
|
||||||
return
|
if color_settings["enabled"]:
|
||||||
|
view_space = color_settings["review_color_space"]
|
||||||
|
# skip if review color space setting is empty.
|
||||||
|
if view_space and \
|
||||||
|
rop_node.evalParm("ociocolorspace") != view_space:
|
||||||
|
|
||||||
if rop_node.evalParm("ociocolorspace") != \
|
raise PublishValidationError(
|
||||||
color_settings["review_color_space"]:
|
"Invalid value: Colorspace name doesn't match studio "
|
||||||
|
"settings.\nCheck 'OCIO Colorspace' parameter on '{}' ROP"
|
||||||
raise PublishValidationError(
|
.format(rop_node.path())
|
||||||
"Invalid value: Colorspace name doesn't match studio "
|
)
|
||||||
"settings.\nCheck 'OCIO Colorspace' parameter on '{}' ROP"
|
|
||||||
.format(rop_node.path())
|
|
||||||
)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def repair(cls, instance):
|
def repair(cls, instance):
|
||||||
|
|
@ -84,12 +85,12 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin,
|
||||||
|
|
||||||
It sets ociocolorspace parameter.
|
It sets ociocolorspace parameter.
|
||||||
|
|
||||||
if workfile settings are enabled, it will use the value
|
If workfile settings are enabled, it will use the value
|
||||||
exposed in the settings.
|
exposed in the settings.
|
||||||
|
|
||||||
if workfile settings are disabled, it will use the default
|
If the value exposed in the settings is empty,
|
||||||
colorspace corresponding to the display & view of
|
it will use the default colorspace corresponding to
|
||||||
the current Houdini session.
|
the display & view of the current Houdini session.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
opengl_node = hou.node(instance.data["instance_node"])
|
opengl_node = hou.node(instance.data["instance_node"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue