mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
BigRoy's comments
This commit is contained in:
parent
087aca6d8b
commit
c2b948d35f
3 changed files with 11 additions and 34 deletions
|
|
@ -37,47 +37,30 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin,
|
||||||
if not self.is_active(instance.data):
|
if not self.is_active(instance.data):
|
||||||
return
|
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:
|
if os.getenv("OCIO") is None:
|
||||||
cls.log.debug(
|
self.log.debug(
|
||||||
"Default Houdini colorspace is used, "
|
"Default Houdini colorspace is used, "
|
||||||
" skipping check.."
|
" skipping check.."
|
||||||
)
|
)
|
||||||
return None, None
|
return
|
||||||
|
|
||||||
|
rop_node = hou.node(instance.data["instance_node"])
|
||||||
if rop_node.evalParm("colorcorrect") != 2:
|
if rop_node.evalParm("colorcorrect") != 2:
|
||||||
# any colorspace settings other than default requires
|
# any colorspace settings other than default requires
|
||||||
# 'Color Correct' parm to be set to 'OpenColorIO'
|
# 'Color Correct' parm to be set to 'OpenColorIO'
|
||||||
error = (
|
raise PublishValidationError(
|
||||||
"'Color Correction' parm on '{}' ROP must be set to"
|
"'Color Correction' parm on '{}' ROP must be set to"
|
||||||
" 'OpenColorIO'".format(rop_node.path())
|
" 'OpenColorIO'".format(rop_node.path())
|
||||||
)
|
)
|
||||||
return rop_node, error
|
|
||||||
|
|
||||||
if rop_node.evalParm("ociocolorspace") not in \
|
if rop_node.evalParm("ociocolorspace") not in \
|
||||||
hou.Color.ocio_spaces():
|
hou.Color.ocio_spaces():
|
||||||
|
|
||||||
error = (
|
raise PublishValidationError(
|
||||||
"Invalid value: Colorspace name doesn't exist.\n"
|
"Invalid value: Colorspace name doesn't exist.\n"
|
||||||
"Check 'OCIO Colorspace' parameter on '{}' ROP"
|
"Check 'OCIO Colorspace' parameter on '{}' ROP"
|
||||||
.format(rop_node.path())
|
.format(rop_node.path())
|
||||||
)
|
)
|
||||||
return rop_node, error
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_invalid(cls, instance):
|
|
||||||
nodes, _ = cls.get_invalid_with_message(instance)
|
|
||||||
return nodes
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def repair(cls, instance):
|
def repair(cls, instance):
|
||||||
|
|
|
||||||
|
|
@ -648,15 +648,10 @@ def get_display_view_colorspace_subprocess(config_path, display, view):
|
||||||
"--out_path", tmp_json_path,
|
"--out_path", tmp_json_path,
|
||||||
"--display", display,
|
"--display", display,
|
||||||
"--view", view
|
"--view", view
|
||||||
|
|
||||||
]
|
]
|
||||||
log.debug("Executing: {}".format(" ".join(args)))
|
log.debug("Executing: {}".format(" ".join(args)))
|
||||||
|
|
||||||
process_kwargs = {
|
run_openpype_process(*args, logger=log)
|
||||||
"logger": log
|
|
||||||
}
|
|
||||||
|
|
||||||
run_openpype_process(*args, **process_kwargs)
|
|
||||||
|
|
||||||
# return default view colorspace name
|
# return default view colorspace name
|
||||||
with open(tmp_json_path, "r") as f:
|
with open(tmp_json_path, "r") as f:
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ def get_display_view_colorspace_name(in_path, out_path,
|
||||||
display, view):
|
display, view):
|
||||||
"""Aggregate view colorspace name to file.
|
"""Aggregate view colorspace name to file.
|
||||||
|
|
||||||
Wrapper command for processes without acces to OpenColorIO
|
Wrapper command for processes without access to OpenColorIO
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
in_path (str): config file path string
|
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>
|
--out_path=<path> --display=<display> --view=<view>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
json_path = Path(out_path)
|
|
||||||
|
|
||||||
out_data = _get_display_view_colorspace_name(in_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)
|
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__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue