move import inside

This commit is contained in:
Mustafa-Zarkash 2023-09-07 19:30:10 +03:00
parent c92541f5d4
commit 2919d241da
2 changed files with 5 additions and 9 deletions

View file

@ -2,7 +2,6 @@
"""Creator plugin for creating openGL reviews."""
from openpype.hosts.houdini.api import plugin
from openpype.lib import EnumDef, BoolDef, NumberDef
from openpype.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa
import os
import hou
@ -87,7 +86,8 @@ class CreateReview(plugin.HoudiniCreator):
# Set OCIO Colorspace to the default output colorspace
# if there's OCIO
self.set_colorcorrect_to_default_view_space(instance_node)
if os.getenv("OCIO"):
self.set_colorcorrect_to_default_view_space(instance_node)
to_lock = ["id", "family"]
@ -134,13 +134,9 @@ class CreateReview(plugin.HoudiniCreator):
def set_colorcorrect_to_default_view_space(self,
instance_node):
"""Set ociocolorspace to the default output space."""
from openpype.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa
if os.getenv("OCIO") is None:
# No OCIO, skip setting ociocolorspace
return
# if there's OCIO then set Color Correction parameter
# to OpenColorIO
# set Color Correction parameter to OpenColorIO
instance_node.setParms({"colorcorrect": 2})
# Get default view space for ociocolorspace parm.

View file

@ -6,7 +6,6 @@ from openpype.pipeline import (
)
from openpype.pipeline.publish import RepairAction
from openpype.hosts.houdini.api.action import SelectROPAction
from openpype.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa
import os
import hou
@ -69,6 +68,7 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin,
It is a helper action more than a repair action,
used to set colorspace on opengl node to the default view.
"""
from openpype.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa
rop_node = hou.node(instance.data["instance_node"])