BigRoy's comments

This commit is contained in:
Mustafa-Zarkash 2023-09-04 11:09:47 +03:00
parent 087aca6d8b
commit c2b948d35f
3 changed files with 11 additions and 34 deletions

View file

@ -37,47 +37,30 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin,
if not self.is_active(instance.data):
return
invalid_nodes, message = self.get_invalid_with_message(instance)
if invalid_nodes:
raise PublishValidationError(
message,
title=self.label
)
@classmethod
def get_invalid_with_message(cls, instance):
rop_node = hou.node(instance.data["instance_node"])
if os.getenv("OCIO") is None:
cls.log.debug(
self.log.debug(
"Default Houdini colorspace is used, "
" skipping check.."
)
return None, None
return
rop_node = hou.node(instance.data["instance_node"])
if rop_node.evalParm("colorcorrect") != 2:
# any colorspace settings other than default requires
# 'Color Correct' parm to be set to 'OpenColorIO'
error = (
raise PublishValidationError(
"'Color Correction' parm on '{}' ROP must be set to"
" 'OpenColorIO'".format(rop_node.path())
)
return rop_node, error
if rop_node.evalParm("ociocolorspace") not in \
hou.Color.ocio_spaces():
error = (
raise PublishValidationError(
"Invalid value: Colorspace name doesn't exist.\n"
"Check 'OCIO Colorspace' parameter on '{}' ROP"
.format(rop_node.path())
)
return rop_node, error
@classmethod
def get_invalid(cls, instance):
nodes, _ = cls.get_invalid_with_message(instance)
return nodes
@classmethod
def repair(cls, instance):

View file

@ -648,15 +648,10 @@ def get_display_view_colorspace_subprocess(config_path, display, view):
"--out_path", tmp_json_path,
"--display", display,
"--view", view
]
log.debug("Executing: {}".format(" ".join(args)))
process_kwargs = {
"logger": log
}
run_openpype_process(*args, **process_kwargs)
run_openpype_process(*args, logger=log)
# return default view colorspace name
with open(tmp_json_path, "r") as f:

View file

@ -225,7 +225,7 @@ def get_display_view_colorspace_name(in_path, out_path,
display, view):
"""Aggregate view colorspace name to file.
Wrapper command for processes without acces to OpenColorIO
Wrapper command for processes without access to OpenColorIO
Args:
in_path (str): config file path string
@ -239,15 +239,14 @@ def get_display_view_colorspace_name(in_path, out_path,
--out_path=<path> --display=<display> --view=<view>
"""
json_path = Path(out_path)
out_data = _get_display_view_colorspace_name(in_path,
display, view)
display,
view)
with open(json_path, "w") as f:
with open(out_path, "w") as f:
json.dump(out_data, f)
print(f"Display view colorspace saved to '{json_path}'")
print(f"Display view colorspace saved to '{out_path}'")
if __name__ == '__main__':
main()