Fabia's Comments

This commit is contained in:
MustafaJafar 2023-11-17 21:38:10 +02:00
parent cc70c7bbf3
commit 0c3ff0f491
4 changed files with 30 additions and 28 deletions

View file

@ -880,23 +880,23 @@ def set_review_color_space(opengl_node, log=None):
" 'OpenColorIO'".format(opengl_node.path())
)
# Get view space for ociocolorspace parm.
# Get review color space
color_settings = get_houdini_color_settings()
view_space = color_settings["review_color_space"] if color_settings["enabled"] else "" # noqa
review_color_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 review_color_space:
from openpype.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa
view_space = get_default_display_view_colorspace()
review_color_space = get_default_display_view_colorspace()
opengl_node.setParms(
{"ociocolorspace": view_space}
{"ociocolorspace": review_color_space}
)
self.log.debug(
"'OCIO Colorspace' parm on '{}' has been set to "
"the view color space '{}'"
.format(opengl_node, view_space)
.format(opengl_node, review_color_space)
)

View file

@ -33,20 +33,15 @@ class SetDefaultDisplayView(PreLaunchHook):
)
return
# This is a way to get values specified by admins if they already
# added 'OCIO_ACTIVE_DISPLAYS', 'OCIO_ACTIVE_VIEWS' manually
# using Ayon global env vars or Ayon app env vars
# or Ayon houdini tool
OCIO_ACTIVE_DISPLAYS = self.launch_context.env.get(
"OCIO_ACTIVE_DISPLAYS", ""
)
OCIO_ACTIVE_VIEWS = self.launch_context.env.get(
"OCIO_ACTIVE_VIEWS", ""
)
# 'OCIO_ACTIVE_DISPLAYS', 'OCIO_ACTIVE_VIEWS' are checked
# as Admins can add them in Ayon env vars or Ayon tools.
# default_display and default_view
default_display = houdini_color_settings["default_display"]
if default_display:
# get 'OCIO_ACTIVE_DISPLAYS' value if exists.
OCIO_ACTIVE_DISPLAYS = self.launch_context.env.get(
"OCIO_ACTIVE_DISPLAYS", ""
)
default_display = ":".join(
key for key in [default_display, OCIO_ACTIVE_DISPLAYS] if key
)
@ -58,6 +53,10 @@ class SetDefaultDisplayView(PreLaunchHook):
default_view = houdini_color_settings["default_view"]
if default_view:
# get 'OCIO_ACTIVE_VIEWS' value if exists.
OCIO_ACTIVE_VIEWS = self.launch_context.env.get(
"OCIO_ACTIVE_VIEWS", ""
)
default_view = ":".join(
key for key in [default_view, OCIO_ACTIVE_VIEWS] if key
)

View file

@ -46,11 +46,14 @@ class ExtractComposite(publish.Extractor,
"frameEnd": instance.data["frameEndHandle"],
}
# inject colorspace data
# It's always scene_linear (Houdini's default)
self.set_representation_colorspace(
representation, instance.context,
colorspace="scene_linear"
)
if ext == "exr":
# Inject colorspace with 'scene_linear' as that's the
# default Houdini working colorspace and all extracted
# OpenEXR images should be in that colorspace.
# https://www.sidefx.com/docs/houdini/render/linear.html#image-formats
self.set_representation_colorspace(
representation, instance.context,
colorspace="scene_linear"
)
instance.data["representations"].append(representation)

View file

@ -16,7 +16,7 @@ import hou
class SetReviewColorSpaceAction(RepairAction):
label = "Set Review Color Space"
label = "Set Default Review Color Space"
icon = "mdi.monitor"
@ -68,10 +68,10 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin,
color_settings = get_houdini_color_settings()
# skip if houdini color settings are disabled
if color_settings["enabled"]:
view_space = color_settings["review_color_space"]
review_color_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 review_color_space and \
rop_node.evalParm("ociocolorspace") != review_color_space:
raise PublishValidationError(
"Invalid value: Colorspace name doesn't match studio "
@ -81,7 +81,7 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin,
@classmethod
def repair(cls, instance):
"""Set Default View Space Action.
"""Set Default Review Space Action.
It sets ociocolorspace parameter.