From b908665d4c4196acb9aae46f861eea55ffad35d9 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 4 Oct 2023 16:31:27 +0300 Subject: [PATCH 01/39] consider handleStart and End when collecting frames --- openpype/hosts/houdini/api/lib.py | 23 ++++++++--- .../publish/collect_instance_frame_data.py | 40 ++++--------------- .../plugins/publish/collect_instances.py | 14 +------ .../publish/collect_rop_frame_range.py | 16 +++++--- 4 files changed, 35 insertions(+), 58 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index a3f691e1fc..ff6c62a143 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -548,7 +548,7 @@ def get_template_from_value(key, value): return parm -def get_frame_data(node): +def get_frame_data(self, node, asset_data={}): """Get the frame data: start frame, end frame and steps. Args: @@ -561,16 +561,27 @@ def get_frame_data(node): data = {} if node.parm("trange") is None: - + self.log.debug( + "Node has no 'trange' parameter: {}".format(node.path()) + ) return data if node.evalParm("trange") == 0: - self.log.debug("trange is 0") + self.log.debug( + "Node '{}' has 'Render current frame' set. " + "Time range data ignored.".format(node.path()) + ) return data - data["frameStart"] = node.evalParm("f1") - data["frameEnd"] = node.evalParm("f2") - data["steps"] = node.evalParm("f3") + data["frameStartHandle"] = node.evalParm("f1") + data["frameStart"] = node.evalParm("f1") + asset_data.get("handleStart", 0) + data["handleStart"] = asset_data.get("handleStart", 0) + + data["frameEndHandle"] = node.evalParm("f2") + data["frameEnd"] = node.evalParm("f2") - asset_data.get("handleEnd", 0) + data["handleEnd"] = asset_data.get("handleEnd", 0) + + data["byFrameStep"] = node.evalParm("f3") return data diff --git a/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py b/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py index 584343cd64..97d18f97f0 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py +++ b/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py @@ -1,7 +1,7 @@ import hou import pyblish.api - +from openpype.hosts.houdini.api import lib class CollectInstanceNodeFrameRange(pyblish.api.InstancePlugin): """Collect time range frame data for the instance node.""" @@ -15,42 +15,16 @@ class CollectInstanceNodeFrameRange(pyblish.api.InstancePlugin): node_path = instance.data.get("instance_node") node = hou.node(node_path) if node_path else None if not node_path or not node: - self.log.debug("No instance node found for instance: " - "{}".format(instance)) + self.log.debug( + "No instance node found for instance: {}".format(instance) + ) return - frame_data = self.get_frame_data(node) + asset_data = instance.context.data["assetEntity"]["data"] + frame_data = lib.get_frame_data(self, node, asset_data) + if not frame_data: return self.log.info("Collected time data: {}".format(frame_data)) instance.data.update(frame_data) - - def get_frame_data(self, node): - """Get the frame data: start frame, end frame and steps - Args: - node(hou.Node) - - Returns: - dict - - """ - - data = {} - - if node.parm("trange") is None: - self.log.debug("Node has no 'trange' parameter: " - "{}".format(node.path())) - return data - - if node.evalParm("trange") == 0: - # Ignore 'render current frame' - self.log.debug("Node '{}' has 'Render current frame' set. " - "Time range data ignored.".format(node.path())) - return data - - data["frameStart"] = node.evalParm("f1") - data["frameEnd"] = node.evalParm("f2") - data["byFrameStep"] = node.evalParm("f3") - - return data diff --git a/openpype/hosts/houdini/plugins/publish/collect_instances.py b/openpype/hosts/houdini/plugins/publish/collect_instances.py index 3772c9e705..132d297d1d 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_instances.py +++ b/openpype/hosts/houdini/plugins/publish/collect_instances.py @@ -102,16 +102,4 @@ class CollectInstances(pyblish.api.ContextPlugin): """ - data = {} - - if node.parm("trange") is None: - return data - - if node.evalParm("trange") == 0: - return data - - data["frameStart"] = node.evalParm("f1") - data["frameEnd"] = node.evalParm("f2") - data["byFrameStep"] = node.evalParm("f3") - - return data + return lib.get_frame_data(self, node) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index 2a6be6b9f1..d91b9333b2 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -19,16 +19,20 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin): return ropnode = hou.node(node_path) - frame_data = lib.get_frame_data(ropnode) + + asset_data = instance.context.data["assetEntity"]["data"] + frame_data = lib.get_frame_data(self, ropnode, asset_data) if "frameStart" in frame_data and "frameEnd" in frame_data: # Log artist friendly message about the collected frame range message = ( "Frame range {0[frameStart]} - {0[frameEnd]}" - ).format(frame_data) - if frame_data.get("step", 1.0) != 1.0: - message += " with step {0[step]}".format(frame_data) + .format(frame_data) + ) + if frame_data.get("byFrameStep", 1.0) != 1.0: + message += " with step {0[byFrameStep]}".format(frame_data) + self.log.info(message) instance.data.update(frame_data) @@ -36,6 +40,6 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin): # Add frame range to label if the instance has a frame range. label = instance.data.get("label", instance.data["name"]) instance.data["label"] = ( - "{0} [{1[frameStart]} - {1[frameEnd]}]".format(label, - frame_data) + "{0} [{1[frameStart]} - {1[frameEnd]}]" + .format(label,frame_data) ) From 1629c76f2c4fa015b5ba472cc889fc4a9a6c10f2 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 4 Oct 2023 16:42:01 +0300 Subject: [PATCH 02/39] consider handleStart and End in expected files --- openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py | 4 ++-- openpype/hosts/houdini/plugins/publish/collect_karma_rop.py | 4 ++-- openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py | 4 ++-- .../hosts/houdini/plugins/publish/collect_redshift_rop.py | 4 ++-- openpype/hosts/houdini/plugins/publish/collect_vray_rop.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py index 43b8428c60..f1bd10345f 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -126,8 +126,8 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data["frameStart"] - end = instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or instance.data["frameStart"] + end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py index eabb1128d8..0a2fbfbac8 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py @@ -95,8 +95,8 @@ class CollectKarmaROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data["frameStart"] - end = instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or instance.data["frameStart"] + end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py index c4460f5350..5a2e8fc24a 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -118,8 +118,8 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data["frameStart"] - end = instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or instance.data["frameStart"] + end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py index dbb15ab88f..8cfcd93dae 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -132,8 +132,8 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data["frameStart"] - end = instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or instance.data["frameStart"] + end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py index 277f922ba4..823a1a6593 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -115,8 +115,8 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data["frameStart"] - end = instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or instance.data["frameStart"] + end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) From 8ab9e6d6b2e27d254e6ca79f9efdd5c7eafa14e6 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 4 Oct 2023 17:00:01 +0300 Subject: [PATCH 03/39] consider handleStart and End when submitting a deadline render job --- .../plugins/publish/submit_houdini_render_deadline.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 8f21a920be..2dbc17684b 100644 --- a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -65,9 +65,12 @@ class HoudiniSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline): job_info.BatchName += datetime.now().strftime("%d%m%Y%H%M%S") # Deadline requires integers in frame range + start = instance.data.get("frameStartHandle") or instance.data["frameStart"] + end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] + frames = "{start}-{end}x{step}".format( - start=int(instance.data["frameStart"]), - end=int(instance.data["frameEnd"]), + start=int(start), + end=int(end), step=int(instance.data["byFrameStep"]), ) job_info.Frames = frames From cc7f152404f0559520f00a1274fcf1003043213d Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 4 Oct 2023 17:15:42 +0300 Subject: [PATCH 04/39] resolve hound --- openpype/hosts/houdini/api/lib.py | 5 ++++- .../hosts/houdini/plugins/publish/collect_arnold_rop.py | 8 ++++++-- .../hosts/houdini/plugins/publish/collect_karma_rop.py | 8 ++++++-- .../hosts/houdini/plugins/publish/collect_mantra_rop.py | 8 ++++++-- .../hosts/houdini/plugins/publish/collect_redshift_rop.py | 8 ++++++-- .../houdini/plugins/publish/collect_rop_frame_range.py | 2 +- .../hosts/houdini/plugins/publish/collect_vray_rop.py | 8 ++++++-- .../plugins/publish/submit_houdini_render_deadline.py | 7 +++++-- 8 files changed, 40 insertions(+), 14 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index ff6c62a143..964a866a79 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -548,7 +548,7 @@ def get_template_from_value(key, value): return parm -def get_frame_data(self, node, asset_data={}): +def get_frame_data(self, node, asset_data=None): """Get the frame data: start frame, end frame and steps. Args: @@ -558,6 +558,9 @@ def get_frame_data(self, node, asset_data={}): dict: frame data for star, end and steps. """ + if asset_data is None: + asset_data = {} + data = {} if node.parm("trange") is None: diff --git a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py index f1bd10345f..edd71bfa39 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -126,8 +126,12 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or instance.data["frameStart"] - end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or \ + instance.data["frameStart"] + + end = instance.data.get("frameEndHandle") or \ + instance.data["frameEnd"] + for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py index 0a2fbfbac8..564b58ebc2 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py @@ -95,8 +95,12 @@ class CollectKarmaROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or instance.data["frameStart"] - end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or \ + instance.data["frameStart"] + + end = instance.data.get("frameEndHandle") or \ + instance.data["frameEnd"] + for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py index 5a2e8fc24a..5ece889694 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -118,8 +118,12 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or instance.data["frameStart"] - end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or \ + instance.data["frameStart"] + + end = instance.data.get("frameEndHandle") or \ + instance.data["frameEnd"] + for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py index 8cfcd93dae..1705da6a69 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -132,8 +132,12 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or instance.data["frameStart"] - end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or \ + instance.data["frameStart"] + + end = instance.data.get("frameEndHandle") or \ + instance.data["frameEnd"] + for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index d91b9333b2..bf44e019a9 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -41,5 +41,5 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin): label = instance.data.get("label", instance.data["name"]) instance.data["label"] = ( "{0} [{1[frameStart]} - {1[frameEnd]}]" - .format(label,frame_data) + .format(label, frame_data) ) diff --git a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py index 823a1a6593..ec87e3eda3 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -115,8 +115,12 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or instance.data["frameStart"] - end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or \ + instance.data["frameStart"] + + end = instance.data.get("frameEndHandle") or \ + instance.data["frameEnd"] + for i in range(int(start), (int(end) + 1)): expected_files.append( os.path.join(dir, (file % i)).replace("\\", "/")) diff --git a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 2dbc17684b..5dd16306c3 100644 --- a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -65,8 +65,11 @@ class HoudiniSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline): job_info.BatchName += datetime.now().strftime("%d%m%Y%H%M%S") # Deadline requires integers in frame range - start = instance.data.get("frameStartHandle") or instance.data["frameStart"] - end = instance.data.get("frameEndHandle") or instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") or \ + instance.data["frameStart"] + + end = instance.data.get("frameEndHandle") or \ + instance.data["frameEnd"] frames = "{start}-{end}x{step}".format( start=int(start), From 0c63b2691544723769f64ae110ba359bbdb0d73b Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 4 Oct 2023 23:29:25 +0300 Subject: [PATCH 05/39] resolve some comments and add frame range validator --- openpype/hosts/houdini/api/lib.py | 13 ++-- .../plugins/publish/collect_arnold_rop.py | 7 +- .../publish/collect_instance_frame_data.py | 2 +- .../plugins/publish/collect_instances.py | 2 +- .../plugins/publish/collect_karma_rop.py | 7 +- .../plugins/publish/collect_mantra_rop.py | 7 +- .../plugins/publish/collect_redshift_rop.py | 7 +- .../publish/collect_rop_frame_range.py | 2 +- .../plugins/publish/collect_vray_rop.py | 7 +- .../plugins/publish/validate_frame_range.py | 75 +++++++++++++++++++ .../publish/submit_houdini_render_deadline.py | 8 +- 11 files changed, 98 insertions(+), 39 deletions(-) create mode 100644 openpype/hosts/houdini/plugins/publish/validate_frame_range.py diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 964a866a79..711fae7cc4 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -548,7 +548,7 @@ def get_template_from_value(key, value): return parm -def get_frame_data(self, node, asset_data=None): +def get_frame_data(node, asset_data=None, log=None): """Get the frame data: start frame, end frame and steps. Args: @@ -561,28 +561,31 @@ def get_frame_data(self, node, asset_data=None): if asset_data is None: asset_data = {} + if log is None: + log = self.log + data = {} if node.parm("trange") is None: - self.log.debug( + log.debug( "Node has no 'trange' parameter: {}".format(node.path()) ) return data if node.evalParm("trange") == 0: - self.log.debug( + log.debug( "Node '{}' has 'Render current frame' set. " "Time range data ignored.".format(node.path()) ) return data data["frameStartHandle"] = node.evalParm("f1") - data["frameStart"] = node.evalParm("f1") + asset_data.get("handleStart", 0) data["handleStart"] = asset_data.get("handleStart", 0) + data["frameStart"] = data["frameStartHandle"] + data["handleStart"] data["frameEndHandle"] = node.evalParm("f2") - data["frameEnd"] = node.evalParm("f2") - asset_data.get("handleEnd", 0) data["handleEnd"] = asset_data.get("handleEnd", 0) + data["frameEnd"] = data["frameEndHandle"] - data["handleEnd"] data["byFrameStep"] = node.evalParm("f3") diff --git a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py index edd71bfa39..9933572f4a 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -126,11 +126,8 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or \ - instance.data["frameStart"] - - end = instance.data.get("frameEndHandle") or \ - instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") + end = instance.data.get("frameEndHandle") for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py b/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py index 97d18f97f0..1426eadda1 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py +++ b/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py @@ -21,7 +21,7 @@ class CollectInstanceNodeFrameRange(pyblish.api.InstancePlugin): return asset_data = instance.context.data["assetEntity"]["data"] - frame_data = lib.get_frame_data(self, node, asset_data) + frame_data = lib.get_frame_data(node, asset_data, self.log) if not frame_data: return diff --git a/openpype/hosts/houdini/plugins/publish/collect_instances.py b/openpype/hosts/houdini/plugins/publish/collect_instances.py index 132d297d1d..b2e6107435 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_instances.py +++ b/openpype/hosts/houdini/plugins/publish/collect_instances.py @@ -102,4 +102,4 @@ class CollectInstances(pyblish.api.ContextPlugin): """ - return lib.get_frame_data(self, node) + return lib.get_frame_data(node) diff --git a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py index 564b58ebc2..32790dd550 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py @@ -95,11 +95,8 @@ class CollectKarmaROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or \ - instance.data["frameStart"] - - end = instance.data.get("frameEndHandle") or \ - instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") + end = instance.data.get("frameEndHandle") for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py index 5ece889694..daaf87c04c 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -118,11 +118,8 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or \ - instance.data["frameStart"] - - end = instance.data.get("frameEndHandle") or \ - instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") + end = instance.data.get("frameEndHandle") for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py index 1705da6a69..5ade67d181 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -132,11 +132,8 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or \ - instance.data["frameStart"] - - end = instance.data.get("frameEndHandle") or \ - instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") + end = instance.data.get("frameEndHandle") for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index bf44e019a9..ccaa8b58e0 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -21,7 +21,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin): ropnode = hou.node(node_path) asset_data = instance.context.data["assetEntity"]["data"] - frame_data = lib.get_frame_data(self, ropnode, asset_data) + frame_data = lib.get_frame_data(ropnode, asset_data, self.log) if "frameStart" in frame_data and "frameEnd" in frame_data: diff --git a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py index ec87e3eda3..e5c6ec20c4 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -115,11 +115,8 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") or \ - instance.data["frameStart"] - - end = instance.data.get("frameEndHandle") or \ - instance.data["frameEnd"] + start = instance.data.get("frameStartHandle") + end = instance.data.get("frameEndHandle") for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py new file mode 100644 index 0000000000..e1be99dbcf --- /dev/null +++ b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +import pyblish.api +from openpype.pipeline import PublishValidationError +from openpype.pipeline.publish import RepairAction +from openpype.hosts.houdini.api.action import SelectInvalidAction + +import hou + + +class HotFixAction(RepairAction): + """Set End frame to the minimum valid value.""" + + label = "End frame hotfix" + + +class ValidateFrameRange(pyblish.api.InstancePlugin): + """Validate Frame Range. + + Due to the usage of start and end handles, + then Frame Range must be >= (start handle + end handle) + which results that frameEnd be smaller than frameStart + """ + + order = pyblish.api.ValidatorOrder - 0.1 + hosts = ["houdini"] + label = "Validate Frame Range" + actions = [HotFixAction, SelectInvalidAction] + + def process(self, instance): + + invalid = self.get_invalid(instance) + if invalid: + nodes = [n.path() for n in invalid] + raise PublishValidationError( + "Invalid Frame Range on: {0}".format(nodes), + title="Invalid Frame Range" + ) + + @classmethod + def get_invalid(cls, instance): + + if not instance.data.get("instance_node"): + return + + rop_node = hou.node(instance.data["instance_node"]) + if instance.data["frameStart"] > instance.data["frameEnd"]: + cls.log.error( + "Wrong frame range, please consider handle start and end.\n" + "frameEnd should at least be {}.\n" + "Use \"End frame hotfix\" action to do that." + .format( + instance.data["handleEnd"] + + instance.data["handleStart"] + + instance.data["frameStartHandle"] + ) + ) + return [rop_node] + + @classmethod + def repair(cls, instance): + rop_node = hou.node(instance.data["instance_node"]) + + frame_start = int(instance.data["frameStartHandle"]) + frame_end = int( + instance.data["frameStartHandle"] + + instance.data["handleStart"] + + instance.data["handleEnd"] + ) + + if rop_node.parm("f2").rawValue() == "$FEND": + hou.playbar.setFrameRange(frame_start, frame_end) + hou.playbar.setPlaybackRange(frame_start, frame_end) + hou.setFrame(frame_start) + else: + rop_node.parm("f2").set(frame_end) diff --git a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 5dd16306c3..cd71095920 100644 --- a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -65,12 +65,8 @@ class HoudiniSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline): job_info.BatchName += datetime.now().strftime("%d%m%Y%H%M%S") # Deadline requires integers in frame range - start = instance.data.get("frameStartHandle") or \ - instance.data["frameStart"] - - end = instance.data.get("frameEndHandle") or \ - instance.data["frameEnd"] - + start = instance.data.get("frameStartHandle") + end = instance.data.get("frameEndHandle") frames = "{start}-{end}x{step}".format( start=int(start), end=int(end), From c8f6fb209bafc06dd12f536e64979e244af61c17 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 5 Oct 2023 11:31:30 +0300 Subject: [PATCH 06/39] allow reseting handles, and remove the redundant collector --- openpype/hosts/houdini/api/lib.py | 8 +-- .../publish/collect_instance_frame_data.py | 30 -------- .../plugins/publish/collect_instances.py | 12 ---- .../publish/collect_rop_frame_range.py | 70 ++++++++++++++----- 4 files changed, 58 insertions(+), 62 deletions(-) delete mode 100644 openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 711fae7cc4..3c39b32b0d 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -564,20 +564,20 @@ def get_frame_data(node, asset_data=None, log=None): if log is None: log = self.log - data = {} - if node.parm("trange") is None: log.debug( "Node has no 'trange' parameter: {}".format(node.path()) ) - return data + return if node.evalParm("trange") == 0: log.debug( "Node '{}' has 'Render current frame' set. " "Time range data ignored.".format(node.path()) ) - return data + return + + data = {} data["frameStartHandle"] = node.evalParm("f1") data["handleStart"] = asset_data.get("handleStart", 0) diff --git a/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py b/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py deleted file mode 100644 index 1426eadda1..0000000000 --- a/openpype/hosts/houdini/plugins/publish/collect_instance_frame_data.py +++ /dev/null @@ -1,30 +0,0 @@ -import hou - -import pyblish.api -from openpype.hosts.houdini.api import lib - -class CollectInstanceNodeFrameRange(pyblish.api.InstancePlugin): - """Collect time range frame data for the instance node.""" - - order = pyblish.api.CollectorOrder + 0.001 - label = "Instance Node Frame Range" - hosts = ["houdini"] - - def process(self, instance): - - node_path = instance.data.get("instance_node") - node = hou.node(node_path) if node_path else None - if not node_path or not node: - self.log.debug( - "No instance node found for instance: {}".format(instance) - ) - return - - asset_data = instance.context.data["assetEntity"]["data"] - frame_data = lib.get_frame_data(node, asset_data, self.log) - - if not frame_data: - return - - self.log.info("Collected time data: {}".format(frame_data)) - instance.data.update(frame_data) diff --git a/openpype/hosts/houdini/plugins/publish/collect_instances.py b/openpype/hosts/houdini/plugins/publish/collect_instances.py index b2e6107435..52966fb3c2 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_instances.py +++ b/openpype/hosts/houdini/plugins/publish/collect_instances.py @@ -91,15 +91,3 @@ class CollectInstances(pyblish.api.ContextPlugin): context[:] = sorted(context, key=sort_by_family) return context - - def get_frame_data(self, node): - """Get the frame data: start frame, end frame and steps - Args: - node(hou.Node) - - Returns: - dict - - """ - - return lib.get_frame_data(node) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index ccaa8b58e0..75c101ed0f 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -2,12 +2,17 @@ """Collector plugin for frames data on ROP instances.""" import hou # noqa import pyblish.api +from openpype.lib import BoolDef from openpype.hosts.houdini.api import lib +from openpype.pipeline import OptionalPyblishPluginMixin -class CollectRopFrameRange(pyblish.api.InstancePlugin): +class CollectRopFrameRange(pyblish.api.InstancePlugin, + OptionalPyblishPluginMixin): + """Collect all frames which would be saved from the ROP nodes""" + hosts = ["houdini"] order = pyblish.api.CollectorOrder label = "Collect RopNode Frame Range" @@ -16,30 +21,63 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin): node_path = instance.data.get("instance_node") if node_path is None: # Instance without instance node like a workfile instance + self.log.debug( + "No instance node found for instance: {}".format(instance) + ) return ropnode = hou.node(node_path) - asset_data = instance.context.data["assetEntity"]["data"] + + attr_values = self.get_attr_values_from_data(instance.data) + if attr_values.get("reset_handles"): + asset_data["handleStart"] = 0 + asset_data["handleEnd"] = 0 + frame_data = lib.get_frame_data(ropnode, asset_data, self.log) - if "frameStart" in frame_data and "frameEnd" in frame_data: + if not frame_data: + return - # Log artist friendly message about the collected frame range - message = ( - "Frame range {0[frameStart]} - {0[frameEnd]}" + # Log artist friendly message about the collected frame range + message = "" + + if attr_values.get("reset_handles"): + message += ( + "Reset frame handles is activated for this instance, " + "start and end handles are set to 0.\n" + ) + else: + message += ( + "Full Frame range with Handles " + "{0[frameStartHandle]} - {0[frameEndHandle]}\n" .format(frame_data) ) - if frame_data.get("byFrameStep", 1.0) != 1.0: - message += " with step {0[byFrameStep]}".format(frame_data) - self.log.info(message) + message += ( + "Frame range {0[frameStart]} - {0[frameEnd]}" + .format(frame_data) + ) - instance.data.update(frame_data) + if frame_data.get("byFrameStep", 1.0) != 1.0: + message += "\nFrame steps {0[byFrameStep]}".format(frame_data) - # Add frame range to label if the instance has a frame range. - label = instance.data.get("label", instance.data["name"]) - instance.data["label"] = ( - "{0} [{1[frameStart]} - {1[frameEnd]}]" - .format(label, frame_data) - ) + self.log.info(message) + + instance.data.update(frame_data) + + # Add frame range to label if the instance has a frame range. + label = instance.data.get("label", instance.data["name"]) + instance.data["label"] = ( + "{0} [{1[frameStart]} - {1[frameEnd]}]" + .format(label, frame_data) + ) + + @classmethod + def get_attribute_defs(cls): + return [ + BoolDef("reset_handles", + tooltip="Set frame handles to zero", + default=False, + label="Reset frame handles") + ] From 6e56ba2cc17a384dff0f27ed96e00dd2d7e54e22 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 5 Oct 2023 14:49:34 +0300 Subject: [PATCH 07/39] Bigroy's comments and update attribute def label and tip --- openpype/hosts/houdini/api/lib.py | 8 +++---- .../publish/collect_rop_frame_range.py | 24 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 3c39b32b0d..711fae7cc4 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -564,20 +564,20 @@ def get_frame_data(node, asset_data=None, log=None): if log is None: log = self.log + data = {} + if node.parm("trange") is None: log.debug( "Node has no 'trange' parameter: {}".format(node.path()) ) - return + return data if node.evalParm("trange") == 0: log.debug( "Node '{}' has 'Render current frame' set. " "Time range data ignored.".format(node.path()) ) - return - - data = {} + return data data["frameStartHandle"] = node.evalParm("f1") data["handleStart"] = asset_data.get("handleStart", 0) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index 75c101ed0f..1f65d4eea6 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -30,7 +30,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, asset_data = instance.context.data["assetEntity"]["data"] attr_values = self.get_attr_values_from_data(instance.data) - if attr_values.get("reset_handles"): + if not attr_values.get("use_handles"): asset_data["handleStart"] = 0 asset_data["handleEnd"] = 0 @@ -42,17 +42,17 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, # Log artist friendly message about the collected frame range message = "" - if attr_values.get("reset_handles"): - message += ( - "Reset frame handles is activated for this instance, " - "start and end handles are set to 0.\n" - ) - else: + if attr_values.get("use_handles"): message += ( "Full Frame range with Handles " "{0[frameStartHandle]} - {0[frameEndHandle]}\n" .format(frame_data) ) + else: + message += ( + "Use handles is deactivated for this instance, " + "start and end handles are set to 0.\n" + ) message += ( "Frame range {0[frameStart]} - {0[frameEnd]}" @@ -76,8 +76,10 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, @classmethod def get_attribute_defs(cls): return [ - BoolDef("reset_handles", - tooltip="Set frame handles to zero", - default=False, - label="Reset frame handles") + BoolDef("use_handles", + tooltip="Disable this if you don't want the publisher" + " to ignore start and end handles specified in the asset data" + " for this publish instance", + default=True, + label="Use asset handles") ] From ec2ee09fe974f8500765ec65571996a93945951a Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 5 Oct 2023 14:51:33 +0300 Subject: [PATCH 08/39] resolve hound --- .../hosts/houdini/plugins/publish/collect_rop_frame_range.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index 1f65d4eea6..37db922201 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -78,8 +78,8 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, return [ BoolDef("use_handles", tooltip="Disable this if you don't want the publisher" - " to ignore start and end handles specified in the asset data" - " for this publish instance", + " to ignore start and end handles specified in the" + " asset data for this publish instance", default=True, label="Use asset handles") ] From af67b4780f2daf62bafea4f227aea8e541d83dc6 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 6 Oct 2023 16:33:27 +0300 Subject: [PATCH 09/39] fabia's comments --- .../plugins/publish/collect_rop_frame_range.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index 37db922201..d64ff37eb0 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -43,26 +43,24 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, message = "" if attr_values.get("use_handles"): - message += ( + self.log.info( "Full Frame range with Handles " "{0[frameStartHandle]} - {0[frameEndHandle]}\n" .format(frame_data) ) else: - message += ( + self.log.info( "Use handles is deactivated for this instance, " "start and end handles are set to 0.\n" ) - message += ( + self.log.info( "Frame range {0[frameStart]} - {0[frameEnd]}" .format(frame_data) ) if frame_data.get("byFrameStep", 1.0) != 1.0: - message += "\nFrame steps {0[byFrameStep]}".format(frame_data) - - self.log.info(message) + self.log.info("Frame steps {0[byFrameStep]}".format(frame_data)) instance.data.update(frame_data) @@ -77,8 +75,8 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, def get_attribute_defs(cls): return [ BoolDef("use_handles", - tooltip="Disable this if you don't want the publisher" - " to ignore start and end handles specified in the" + tooltip="Disable this if you want the publisher to" + " ignore start and end handles specified in the" " asset data for this publish instance", default=True, label="Use asset handles") From 0d47f4f57a5f472adbef5ef18c5f80b5c773d250 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 6 Oct 2023 16:41:56 +0300 Subject: [PATCH 10/39] remove repair action --- .../plugins/publish/validate_frame_range.py | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py index e1be99dbcf..cf85e59041 100644 --- a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py @@ -1,18 +1,11 @@ # -*- coding: utf-8 -*- import pyblish.api from openpype.pipeline import PublishValidationError -from openpype.pipeline.publish import RepairAction from openpype.hosts.houdini.api.action import SelectInvalidAction import hou -class HotFixAction(RepairAction): - """Set End frame to the minimum valid value.""" - - label = "End frame hotfix" - - class ValidateFrameRange(pyblish.api.InstancePlugin): """Validate Frame Range. @@ -24,7 +17,7 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder - 0.1 hosts = ["houdini"] label = "Validate Frame Range" - actions = [HotFixAction, SelectInvalidAction] + actions = [SelectInvalidAction] def process(self, instance): @@ -55,21 +48,3 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): ) ) return [rop_node] - - @classmethod - def repair(cls, instance): - rop_node = hou.node(instance.data["instance_node"]) - - frame_start = int(instance.data["frameStartHandle"]) - frame_end = int( - instance.data["frameStartHandle"] + - instance.data["handleStart"] + - instance.data["handleEnd"] - ) - - if rop_node.parm("f2").rawValue() == "$FEND": - hou.playbar.setFrameRange(frame_start, frame_end) - hou.playbar.setPlaybackRange(frame_start, frame_end) - hou.setFrame(frame_start) - else: - rop_node.parm("f2").set(frame_end) From 28c19f1a9b8ae39fe9746b3323f6118fbb71371c Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 6 Oct 2023 16:51:44 +0300 Subject: [PATCH 11/39] resolve hound --- .../hosts/houdini/plugins/publish/collect_rop_frame_range.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index d64ff37eb0..f0a473995c 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -40,8 +40,6 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, return # Log artist friendly message about the collected frame range - message = "" - if attr_values.get("use_handles"): self.log.info( "Full Frame range with Handles " @@ -60,7 +58,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, ) if frame_data.get("byFrameStep", 1.0) != 1.0: - self.log.info("Frame steps {0[byFrameStep]}".format(frame_data)) + self.log.info("Frame steps {0[byFrameStep]}".format(frame_data)) instance.data.update(frame_data) From 4b02645618f1b31ec35452ceaa41dbcd5b623df6 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 6 Oct 2023 17:27:35 +0300 Subject: [PATCH 12/39] update frame data when rendering current frame --- openpype/hosts/houdini/api/lib.py | 19 +++++++++++-------- .../plugins/publish/collect_arnold_rop.py | 4 ++-- .../plugins/publish/collect_karma_rop.py | 4 ++-- .../plugins/publish/collect_mantra_rop.py | 4 ++-- .../plugins/publish/collect_redshift_rop.py | 4 ++-- .../plugins/publish/collect_vray_rop.py | 4 ++-- .../publish/submit_houdini_render_deadline.py | 4 ++-- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 711fae7cc4..d713782efe 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -573,22 +573,25 @@ def get_frame_data(node, asset_data=None, log=None): return data if node.evalParm("trange") == 0: + data["frameStartHandle"] = hou.intFrame() + data["frameEndHandle"] = hou.intFrame() + data["byFrameStep"] = 1.0 log.debug( - "Node '{}' has 'Render current frame' set. " - "Time range data ignored.".format(node.path()) - ) - return data + "Node '{}' has 'Render current frame' set. " + "frameStart and frameEnd are set to the " + "current frame".format(node.path()) + ) + else: + data["frameStartHandle"] = node.evalParm("f1") + data["frameEndHandle"] = node.evalParm("f2") + data["byFrameStep"] = node.evalParm("f3") - data["frameStartHandle"] = node.evalParm("f1") data["handleStart"] = asset_data.get("handleStart", 0) data["frameStart"] = data["frameStartHandle"] + data["handleStart"] - data["frameEndHandle"] = node.evalParm("f2") data["handleEnd"] = asset_data.get("handleEnd", 0) data["frameEnd"] = data["frameEndHandle"] - data["handleEnd"] - data["byFrameStep"] = node.evalParm("f3") - return data diff --git a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py index 9933572f4a..28389c3b31 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -126,8 +126,8 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") - end = instance.data.get("frameEndHandle") + start = instance.data["frameStartHandle"] + end = instance.data["frameEndHandle"] for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py index 32790dd550..b66dcde13f 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py @@ -95,8 +95,8 @@ class CollectKarmaROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") - end = instance.data.get("frameEndHandle") + start = instance.data["frameStartHandle"] + end = instance.data["frameEndHandle"] for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py index daaf87c04c..3b7cf59f32 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -118,8 +118,8 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") - end = instance.data.get("frameEndHandle") + start = instance.data["frameStartHandle"] + end = instance.data["frameEndHandle"] for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py index 5ade67d181..ca171a91f9 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -132,8 +132,8 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") - end = instance.data.get("frameEndHandle") + start = instance.data["frameStartHandle"] + end = instance.data["frameEndHandle"] for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py index e5c6ec20c4..b1ff4c1886 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -115,8 +115,8 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): return path expected_files = [] - start = instance.data.get("frameStartHandle") - end = instance.data.get("frameEndHandle") + start = instance.data["frameStartHandle"] + end = instance.data["frameEndHandle"] for i in range(int(start), (int(end) + 1)): expected_files.append( diff --git a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index cd71095920..6f885c578a 100644 --- a/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -65,8 +65,8 @@ class HoudiniSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline): job_info.BatchName += datetime.now().strftime("%d%m%Y%H%M%S") # Deadline requires integers in frame range - start = instance.data.get("frameStartHandle") - end = instance.data.get("frameEndHandle") + start = instance.data["frameStartHandle"] + end = instance.data["frameEndHandle"] frames = "{start}-{end}x{step}".format( start=int(start), end=int(end), From b4a01faa65ebc7a08528eae75271159ac886c38f Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 6 Oct 2023 17:28:59 +0300 Subject: [PATCH 13/39] resolve hound --- openpype/hosts/houdini/api/lib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index d713782efe..52d5fb4e03 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -577,10 +577,10 @@ def get_frame_data(node, asset_data=None, log=None): data["frameEndHandle"] = hou.intFrame() data["byFrameStep"] = 1.0 log.debug( - "Node '{}' has 'Render current frame' set. " - "frameStart and frameEnd are set to the " - "current frame".format(node.path()) - ) + "Node '{}' has 'Render current frame' set. " + "frameStart and frameEnd are set to the " + "current frame".format(node.path()) + ) else: data["frameStartHandle"] = node.evalParm("f1") data["frameEndHandle"] = node.evalParm("f2") From 47425e3aa460a012a4fc6265ff5b4fdfcc345fc5 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 6 Oct 2023 22:54:00 +0300 Subject: [PATCH 14/39] expose use asset handles to houdini settings --- .../plugins/publish/collect_rop_frame_range.py | 7 ++++--- .../defaults/project_settings/houdini.json | 3 +++ .../schemas/schema_houdini_publish.json | 17 +++++++++++++++++ .../houdini/server/settings/publish_plugins.py | 17 +++++++++++++++++ 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index f0a473995c..becadf2833 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -15,6 +15,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, hosts = ["houdini"] order = pyblish.api.CollectorOrder label = "Collect RopNode Frame Range" + use_asset_handles = True def process(self, instance): @@ -40,7 +41,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, return # Log artist friendly message about the collected frame range - if attr_values.get("use_handles"): + if attr_values.get("use_asset_handles"): self.log.info( "Full Frame range with Handles " "{0[frameStartHandle]} - {0[frameEndHandle]}\n" @@ -72,10 +73,10 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, @classmethod def get_attribute_defs(cls): return [ - BoolDef("use_handles", + BoolDef("use_asset_handles", tooltip="Disable this if you want the publisher to" " ignore start and end handles specified in the" " asset data for this publish instance", - default=True, + default=cls.use_asset_handles, label="Use asset handles") ] diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index 4f57ee52c6..14fc0c1655 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -106,6 +106,9 @@ } }, "publish": { + "CollectRopFrameRange": { + "use_asset_handles": true + }, "ValidateWorkfilePaths": { "enabled": true, "optional": true, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_publish.json index d5f70b0312..d030b3bdd3 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_publish.json @@ -4,6 +4,23 @@ "key": "publish", "label": "Publish plugins", "children": [ + { + "type": "dict", + "collapsible": true, + "key": "CollectRopFrameRange", + "label": "Collect Rop Frame Range", + "children": [ + { + "type": "label", + "label": "Disable this if you want the publisher to ignore start and end handles specified in the asset data for publish instances" + }, + { + "type": "boolean", + "key": "use_asset_handles", + "label": "Use asset handles" + } + ] + }, { "type": "dict", "collapsible": true, diff --git a/server_addon/houdini/server/settings/publish_plugins.py b/server_addon/houdini/server/settings/publish_plugins.py index 58240b0205..b975a9edfd 100644 --- a/server_addon/houdini/server/settings/publish_plugins.py +++ b/server_addon/houdini/server/settings/publish_plugins.py @@ -151,6 +151,16 @@ class ValidateWorkfilePathsModel(BaseSettingsModel): ) +class CollectRopFrameRangeModel(BaseSettingsModel): + """Collect Frame Range + + Disable this if you want the publisher to + ignore start and end handles specified in the + asset data for publish instances + """ + use_asset_handles: bool = Field(title="Use asset handles") + + class BasicValidateModel(BaseSettingsModel): enabled: bool = Field(title="Enabled") optional: bool = Field(title="Optional") @@ -158,6 +168,10 @@ class BasicValidateModel(BaseSettingsModel): class PublishPluginsModel(BaseSettingsModel): + CollectRopFrameRange:CollectRopFrameRangeModel = Field( + default_factory=CollectRopFrameRangeModel, + title="Collect Rop Frame Range." + ) ValidateWorkfilePaths: ValidateWorkfilePathsModel = Field( default_factory=ValidateWorkfilePathsModel, title="Validate workfile paths settings.") @@ -179,6 +193,9 @@ class PublishPluginsModel(BaseSettingsModel): DEFAULT_HOUDINI_PUBLISH_SETTINGS = { + "CollectRopFrameRange": { + "use_asset_handles": True + }, "ValidateWorkfilePaths": { "enabled": True, "optional": True, From ffb61e27efb222ec9f93f4c42b8491e7249fff3e Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 6 Oct 2023 23:20:59 +0300 Subject: [PATCH 15/39] fix a bug --- .../hosts/houdini/plugins/publish/collect_rop_frame_range.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index becadf2833..c9bc1766cb 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -41,7 +41,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, return # Log artist friendly message about the collected frame range - if attr_values.get("use_asset_handles"): + if attr_values.get("use_handles"): self.log.info( "Full Frame range with Handles " "{0[frameStartHandle]} - {0[frameEndHandle]}\n" @@ -73,7 +73,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, @classmethod def get_attribute_defs(cls): return [ - BoolDef("use_asset_handles", + BoolDef("use_handles", tooltip="Disable this if you want the publisher to" " ignore start and end handles specified in the" " asset data for this publish instance", From 5f952c89d3933a61a335ae283f5ebe9ece398c09 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Fri, 6 Oct 2023 23:28:58 +0300 Subject: [PATCH 16/39] resolve hound and bump addon version --- server_addon/houdini/server/settings/publish_plugins.py | 2 +- server_addon/houdini/server/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/server/settings/publish_plugins.py b/server_addon/houdini/server/settings/publish_plugins.py index b975a9edfd..76030bdeea 100644 --- a/server_addon/houdini/server/settings/publish_plugins.py +++ b/server_addon/houdini/server/settings/publish_plugins.py @@ -168,7 +168,7 @@ class BasicValidateModel(BaseSettingsModel): class PublishPluginsModel(BaseSettingsModel): - CollectRopFrameRange:CollectRopFrameRangeModel = Field( + CollectRopFrameRange: CollectRopFrameRangeModel = Field( default_factory=CollectRopFrameRangeModel, title="Collect Rop Frame Range." ) diff --git a/server_addon/houdini/server/version.py b/server_addon/houdini/server/version.py index bbab0242f6..1276d0254f 100644 --- a/server_addon/houdini/server/version.py +++ b/server_addon/houdini/server/version.py @@ -1 +1 @@ -__version__ = "0.1.4" +__version__ = "0.1.5" From 847f73deadd24f35b9f7567ea844cbc23db192fb Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Mon, 9 Oct 2023 10:52:13 +0300 Subject: [PATCH 17/39] ignore asset handles when rendering the current frame --- openpype/hosts/houdini/api/lib.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 56444afc12..6d57d959e6 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -580,8 +580,11 @@ def get_frame_data(node, asset_data=None, log=None): data["frameStartHandle"] = hou.intFrame() data["frameEndHandle"] = hou.intFrame() data["byFrameStep"] = 1.0 - log.debug( - "Node '{}' has 'Render current frame' set. " + data["handleStart"] = 0 + data["handleEnd"] = 0 + log.info( + "Node '{}' has 'Render current frame' set. \n" + "Asset Handles are ignored. \n" "frameStart and frameEnd are set to the " "current frame".format(node.path()) ) @@ -589,11 +592,10 @@ def get_frame_data(node, asset_data=None, log=None): data["frameStartHandle"] = node.evalParm("f1") data["frameEndHandle"] = node.evalParm("f2") data["byFrameStep"] = node.evalParm("f3") + data["handleStart"] = asset_data.get("handleStart", 0) + data["handleEnd"] = asset_data.get("handleEnd", 0) - data["handleStart"] = asset_data.get("handleStart", 0) data["frameStart"] = data["frameStartHandle"] + data["handleStart"] - - data["handleEnd"] = asset_data.get("handleEnd", 0) data["frameEnd"] = data["frameEndHandle"] - data["handleEnd"] return data From b1b24d49b00f4369fcd15e77b471d352bedf684f Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 11 Oct 2023 10:45:27 +0300 Subject: [PATCH 18/39] use int frameStartHandle and frameEndHandle --- openpype/hosts/houdini/api/lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 6d57d959e6..7ff86fe5ae 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -589,8 +589,8 @@ def get_frame_data(node, asset_data=None, log=None): "current frame".format(node.path()) ) else: - data["frameStartHandle"] = node.evalParm("f1") - data["frameEndHandle"] = node.evalParm("f2") + data["frameStartHandle"] = int(node.evalParm("f1")) + data["frameEndHandle"] = int(node.evalParm("f2")) data["byFrameStep"] = node.evalParm("f3") data["handleStart"] = asset_data.get("handleStart", 0) data["handleEnd"] = asset_data.get("handleEnd", 0) From f52dc88a17415c667220dc3e3ef4fc3f5b14a074 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 11 Oct 2023 12:03:05 +0300 Subject: [PATCH 19/39] fix typo --- openpype/hosts/houdini/api/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 7ff86fe5ae..8810e1520f 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -559,7 +559,7 @@ def get_frame_data(node, asset_data=None, log=None): node(hou.Node) Returns: - dict: frame data for star, end and steps. + dict: frame data for start, end and steps. """ if asset_data is None: From 99dcca56d55035a7ddec249cd7bf85e9a4168e6b Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 11 Oct 2023 12:03:50 +0300 Subject: [PATCH 20/39] better error message --- .../plugins/publish/validate_frame_range.py | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py index cf85e59041..30b736dbd0 100644 --- a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py @@ -23,10 +23,25 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): invalid = self.get_invalid(instance) if invalid: - nodes = [n.path() for n in invalid] + node = invalid[0].path() raise PublishValidationError( - "Invalid Frame Range on: {0}".format(nodes), - title="Invalid Frame Range" + title="Invalid Frame Range", + message=( + "Invalid frame range because the instance start frame ({0[frameStart]}) " + "is higher than the end frame ({0[frameEnd]})" + .format(instance.data) + ), + description=( + "## Invalid Frame Range\n" + "The frame range for the instance is invalid because the " + "start frame is higher than the end frame.\n\nThis is likely " + "due to asset handles being applied to your instance or may " + "be because the ROP node's start frame is set higher than the " + "end frame.\n\nIf your ROP frame range is correct and you do " + "not want to apply asset handles make sure to disable Use " + "asset handles on the publish instance.\n\n" + "Associated Node: \"{0}\"".format(node) + ) ) @classmethod @@ -37,14 +52,11 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): rop_node = hou.node(instance.data["instance_node"]) if instance.data["frameStart"] > instance.data["frameEnd"]: - cls.log.error( - "Wrong frame range, please consider handle start and end.\n" - "frameEnd should at least be {}.\n" - "Use \"End frame hotfix\" action to do that." - .format( - instance.data["handleEnd"] + - instance.data["handleStart"] + - instance.data["frameStartHandle"] - ) + cls.log.info( + "The ROP node render range is set to " + "{0[frameStartHandle]} - {0[frameEndHandle]} " + "The asset handles applied to the instance are start handle " + "{0[handleStart]} and end handle {0[handleEnd]}" + .format(instance.data) ) return [rop_node] From b2f613966cf7b6014d0fba47a134365a9079faf3 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 11 Oct 2023 12:07:56 +0300 Subject: [PATCH 21/39] rexolve hound --- .../plugins/publish/validate_frame_range.py | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py index 30b736dbd0..936eb1180d 100644 --- a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py @@ -27,20 +27,22 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): raise PublishValidationError( title="Invalid Frame Range", message=( - "Invalid frame range because the instance start frame ({0[frameStart]}) " - "is higher than the end frame ({0[frameEnd]})" + "Invalid frame range because the instance " + "start frame ({0[frameStart]}) is higher than " + "the end frame ({0[frameEnd]})" .format(instance.data) ), description=( "## Invalid Frame Range\n" - "The frame range for the instance is invalid because the " - "start frame is higher than the end frame.\n\nThis is likely " - "due to asset handles being applied to your instance or may " - "be because the ROP node's start frame is set higher than the " - "end frame.\n\nIf your ROP frame range is correct and you do " - "not want to apply asset handles make sure to disable Use " - "asset handles on the publish instance.\n\n" - "Associated Node: \"{0}\"".format(node) + "The frame range for the instance is invalid because " + "the start frame is higher than the end frame.\n\nThis " + "is likely due to asset handles being applied to your " + "instance or may be because the ROP node's start frame " + "is set higher than the end frame.\n\nIf your ROP frame " + "range is correct and you do not want to apply asset " + "handles make sure to disable Use asset handles on the " + "publish instance.\n\nAssociated Node: \"{0}\"" + .format(node) ) ) From c389ccb5875353d32c3e535880108c0a648cd060 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 11 Oct 2023 13:18:47 +0300 Subject: [PATCH 22/39] make description not instance specific --- .../hosts/houdini/plugins/publish/validate_frame_range.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py index 936eb1180d..2411d29e3e 100644 --- a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py @@ -23,7 +23,6 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): invalid = self.get_invalid(instance) if invalid: - node = invalid[0].path() raise PublishValidationError( title="Invalid Frame Range", message=( @@ -41,8 +40,7 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): "is set higher than the end frame.\n\nIf your ROP frame " "range is correct and you do not want to apply asset " "handles make sure to disable Use asset handles on the " - "publish instance.\n\nAssociated Node: \"{0}\"" - .format(node) + "publish instance." ) ) From 1ecf502e9a25538d55d47c8af12d2053654279b3 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 18 Oct 2023 17:09:20 +0300 Subject: [PATCH 23/39] add collectors section in Houdini settings --- .../projects_schema/schemas/schema_houdini_publish.json | 4 ++++ server_addon/houdini/server/settings/publish_plugins.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_publish.json index d030b3bdd3..7bdb643dbb 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_publish.json @@ -4,6 +4,10 @@ "key": "publish", "label": "Publish plugins", "children": [ + { + "type":"label", + "label":"Collectors" + }, { "type": "dict", "collapsible": true, diff --git a/server_addon/houdini/server/settings/publish_plugins.py b/server_addon/houdini/server/settings/publish_plugins.py index 76030bdeea..a19fb4bca9 100644 --- a/server_addon/houdini/server/settings/publish_plugins.py +++ b/server_addon/houdini/server/settings/publish_plugins.py @@ -158,7 +158,8 @@ class CollectRopFrameRangeModel(BaseSettingsModel): ignore start and end handles specified in the asset data for publish instances """ - use_asset_handles: bool = Field(title="Use asset handles") + use_asset_handles: bool = Field( + title="Use asset handles") class BasicValidateModel(BaseSettingsModel): @@ -170,7 +171,8 @@ class BasicValidateModel(BaseSettingsModel): class PublishPluginsModel(BaseSettingsModel): CollectRopFrameRange: CollectRopFrameRangeModel = Field( default_factory=CollectRopFrameRangeModel, - title="Collect Rop Frame Range." + title="Collect Rop Frame Range.", + section="Collectors" ) ValidateWorkfilePaths: ValidateWorkfilePathsModel = Field( default_factory=ValidateWorkfilePathsModel, From 520ff86cd044c15328fa936cc452301836626943 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 18 Oct 2023 17:32:10 +0300 Subject: [PATCH 24/39] bump houdini addon version --- server_addon/houdini/server/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/server/version.py b/server_addon/houdini/server/version.py index 1276d0254f..0a8da88258 100644 --- a/server_addon/houdini/server/version.py +++ b/server_addon/houdini/server/version.py @@ -1 +1 @@ -__version__ = "0.1.5" +__version__ = "0.1.6" From bb4778e71bff7ba54e017eb35f252c7a916c132b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 18 Oct 2023 18:17:08 +0300 Subject: [PATCH 25/39] MinKiu Comments --- .../publish/collect_rop_frame_range.py | 27 ++++++++++++++----- .../plugins/publish/validate_frame_range.py | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index c9bc1766cb..c610deba40 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -41,11 +41,17 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, return # Log artist friendly message about the collected frame range + frame_start=frame_data["frameStart"] + frame_end=frame_data["frameEnd"] + if attr_values.get("use_handles"): self.log.info( "Full Frame range with Handles " - "{0[frameStartHandle]} - {0[frameEndHandle]}\n" - .format(frame_data) + "[{frame_start_handle} - {frame_end_handle}]\n" + .format( + frame_start_handle=frame_data["frameStartHandle"], + frame_end_handle=frame_data["frameEndHandle"] + ) ) else: self.log.info( @@ -54,20 +60,27 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, ) self.log.info( - "Frame range {0[frameStart]} - {0[frameEnd]}" - .format(frame_data) + "Frame range [{frame_start} - {frame_end}]" + .format( + frame_start=frame_start, + frame_end=frame_end + ) ) if frame_data.get("byFrameStep", 1.0) != 1.0: - self.log.info("Frame steps {0[byFrameStep]}".format(frame_data)) + self.log.info("Frame steps {}".format(frame_data["byFrameStep"])) instance.data.update(frame_data) # Add frame range to label if the instance has a frame range. label = instance.data.get("label", instance.data["name"]) instance.data["label"] = ( - "{0} [{1[frameStart]} - {1[frameEnd]}]" - .format(label, frame_data) + "{label} [{frame_start} - {frame_end}]" + .format( + label=label, + frame_start=frame_start, + frame_end=frame_end + ) ) @classmethod diff --git a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py index 2411d29e3e..b35ab62002 100644 --- a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py @@ -36,7 +36,7 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): "The frame range for the instance is invalid because " "the start frame is higher than the end frame.\n\nThis " "is likely due to asset handles being applied to your " - "instance or may be because the ROP node's start frame " + "instance or the ROP node's start frame " "is set higher than the end frame.\n\nIf your ROP frame " "range is correct and you do not want to apply asset " "handles make sure to disable Use asset handles on the " From f2ad5ee2536c8492363bc64b1a8110c37bd27ec3 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 18 Oct 2023 18:19:07 +0300 Subject: [PATCH 26/39] resolve hound --- .../hosts/houdini/plugins/publish/collect_rop_frame_range.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index c610deba40..91d5a5ef74 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -41,8 +41,8 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, return # Log artist friendly message about the collected frame range - frame_start=frame_data["frameStart"] - frame_end=frame_data["frameEnd"] + frame_start = frame_data["frameStart"] + frame_end = frame_data["frameEnd"] if attr_values.get("use_handles"): self.log.info( From 3797ad5bb7cf2cfc578534e423ac956c5994a0a5 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 19 Oct 2023 11:14:05 +0300 Subject: [PATCH 27/39] BigRoy's comments - better logging and removing unnecessary logic --- openpype/hosts/houdini/api/lib.py | 17 ++++------ .../publish/collect_rop_frame_range.py | 34 +++++++++---------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 58be3c3836..70bc107d7f 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -559,7 +559,7 @@ def get_template_from_value(key, value): return parm -def get_frame_data(node, asset_data=None, log=None): +def get_frame_data(node, handle_start=0, handle_end=0, log=None): """Get the frame data: start frame, end frame and steps. Args: @@ -569,8 +569,6 @@ def get_frame_data(node, asset_data=None, log=None): dict: frame data for start, end and steps. """ - if asset_data is None: - asset_data = {} if log is None: log = self.log @@ -587,21 +585,20 @@ def get_frame_data(node, asset_data=None, log=None): data["frameStartHandle"] = hou.intFrame() data["frameEndHandle"] = hou.intFrame() data["byFrameStep"] = 1.0 - data["handleStart"] = 0 - data["handleEnd"] = 0 + log.info( - "Node '{}' has 'Render current frame' set. \n" - "Asset Handles are ignored. \n" + "Node '{}' has 'Render current frame' set.\n" + "Asset Handles are ignored.\n" "frameStart and frameEnd are set to the " - "current frame".format(node.path()) + "current frame.".format(node.path()) ) else: data["frameStartHandle"] = int(node.evalParm("f1")) data["frameEndHandle"] = int(node.evalParm("f2")) data["byFrameStep"] = node.evalParm("f3") - data["handleStart"] = asset_data.get("handleStart", 0) - data["handleEnd"] = asset_data.get("handleEnd", 0) + data["handleStart"] = handle_start + data["handleEnd"] = handle_end data["frameStart"] = data["frameStartHandle"] + data["handleStart"] data["frameEnd"] = data["frameEndHandle"] - data["handleEnd"] diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index 91d5a5ef74..f34b1faa77 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -4,11 +4,11 @@ import hou # noqa import pyblish.api from openpype.lib import BoolDef from openpype.hosts.houdini.api import lib -from openpype.pipeline import OptionalPyblishPluginMixin +from openpype.pipeline import OpenPypePyblishPluginMixin class CollectRopFrameRange(pyblish.api.InstancePlugin, - OptionalPyblishPluginMixin): + OpenPypePyblishPluginMixin): """Collect all frames which would be saved from the ROP nodes""" @@ -28,14 +28,20 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, return ropnode = hou.node(node_path) - asset_data = instance.context.data["assetEntity"]["data"] attr_values = self.get_attr_values_from_data(instance.data) - if not attr_values.get("use_handles"): - asset_data["handleStart"] = 0 - asset_data["handleEnd"] = 0 - frame_data = lib.get_frame_data(ropnode, asset_data, self.log) + if attr_values.get("use_handles", self.use_asset_handles): + asset_data = instance.context.data["assetEntity"]["data"] + handle_start = asset_data.get("handleStart", 0) + handle_end = asset_data.get("handleEnd", 0) + else: + handle_start = 0 + handle_end = 0 + + frame_data = lib.get_frame_data( + ropnode, handle_start, handle_end, self.log + ) if not frame_data: return @@ -47,26 +53,18 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, if attr_values.get("use_handles"): self.log.info( "Full Frame range with Handles " - "[{frame_start_handle} - {frame_end_handle}]\n" + "[{frame_start_handle} - {frame_end_handle}]" .format( frame_start_handle=frame_data["frameStartHandle"], frame_end_handle=frame_data["frameEndHandle"] ) ) else: - self.log.info( + self.log.debug( "Use handles is deactivated for this instance, " - "start and end handles are set to 0.\n" + "start and end handles are set to 0." ) - self.log.info( - "Frame range [{frame_start} - {frame_end}]" - .format( - frame_start=frame_start, - frame_end=frame_end - ) - ) - if frame_data.get("byFrameStep", 1.0) != 1.0: self.log.info("Frame steps {}".format(frame_data["byFrameStep"])) From e17ffd1c3d01a42f2655791d2263edf516393f04 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 19 Oct 2023 12:05:49 +0300 Subject: [PATCH 28/39] BigRoy's comment - better logging --- .../plugins/publish/collect_rop_frame_range.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index f34b1faa77..875dd2da8a 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -51,7 +51,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, frame_end = frame_data["frameEnd"] if attr_values.get("use_handles"): - self.log.info( + self.log.debug( "Full Frame range with Handles " "[{frame_start_handle} - {frame_end_handle}]" .format( @@ -65,6 +65,17 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, "start and end handles are set to 0." ) + message = "Frame range [{frame_start} - {frame_end}]".format( + frame_start=frame_start, + frame_end=frame_end + ) + if handle_start or handle_end: + message += " with handles [{handle_start}]-[{handle_end}]".format( + handle_start=handle_start, + handle_end=handle_end + ) + self.log.info(message) + if frame_data.get("byFrameStep", 1.0) != 1.0: self.log.info("Frame steps {}".format(frame_data["byFrameStep"])) From b3078ed40f737b3b191898f34303df3b632de8e4 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 19 Oct 2023 12:08:00 +0300 Subject: [PATCH 29/39] resolve hound --- .../houdini/plugins/publish/collect_rop_frame_range.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index 875dd2da8a..6a1871afdc 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -66,9 +66,9 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, ) message = "Frame range [{frame_start} - {frame_end}]".format( - frame_start=frame_start, - frame_end=frame_end - ) + frame_start=frame_start, + frame_end=frame_end + ) if handle_start or handle_end: message += " with handles [{handle_start}]-[{handle_end}]".format( handle_start=handle_start, From 100ba33cb296dd1265ad461e3dea85c7f97fe3a2 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 19 Oct 2023 14:34:06 +0300 Subject: [PATCH 30/39] update doc string --- openpype/hosts/houdini/api/lib.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index ed06ec539e..eab77ca19a 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -569,13 +569,23 @@ def get_template_from_value(key, value): def get_frame_data(node, handle_start=0, handle_end=0, log=None): - """Get the frame data: start frame, end frame and steps. + """Get the frame data: start frame, end frame, steps, + start frame with start handle and end frame with end handle. + + This function uses Houdini node as the source of truth + therefore users are allowed to publish their desired frame range. + + It also calculates frame start and end with handles. Args: node(hou.Node) + handle_start(int) + handle_end(int) + log(logging.Logger) Returns: - dict: frame data for start, end and steps. + dict: frame data for start, end, steps, + start with handle and end with handle """ From 100d1d9ca67883bdb956bfc7ac1cb7471d1c9a5a Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 19 Oct 2023 15:23:16 +0300 Subject: [PATCH 31/39] BigRoy's comments: add a commetn and a default value for dictionary get --- .../hosts/houdini/plugins/publish/collect_rop_frame_range.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index 6a1871afdc..a368e77ff7 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -46,11 +46,11 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, if not frame_data: return - # Log artist friendly message about the collected frame range + # Log debug message about the collected frame range frame_start = frame_data["frameStart"] frame_end = frame_data["frameEnd"] - if attr_values.get("use_handles"): + if attr_values.get("use_handles", self.use_asset_handles): self.log.debug( "Full Frame range with Handles " "[{frame_start_handle} - {frame_end_handle}]" @@ -65,6 +65,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, "start and end handles are set to 0." ) + # Log collected frame range to the user message = "Frame range [{frame_start} - {frame_end}]".format( frame_start=frame_start, frame_end=frame_end From 25311caace08d2b663cd07293bb8266d88685ea3 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 19 Oct 2023 19:42:17 +0300 Subject: [PATCH 32/39] add repait action to turn off use handles for the failed instance --- .../plugins/publish/validate_frame_range.py | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py index b35ab62002..343cf3c5e4 100644 --- a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py @@ -1,11 +1,17 @@ # -*- coding: utf-8 -*- import pyblish.api from openpype.pipeline import PublishValidationError +from openpype.pipeline.publish import RepairAction from openpype.hosts.houdini.api.action import SelectInvalidAction import hou +class DisableUseAssetHandlesAction(RepairAction): + label = "Disable use asset handles" + icon = "mdi.toggle-switch-off" + + class ValidateFrameRange(pyblish.api.InstancePlugin): """Validate Frame Range. @@ -17,7 +23,7 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder - 0.1 hosts = ["houdini"] label = "Validate Frame Range" - actions = [SelectInvalidAction] + actions = [DisableUseAssetHandlesAction, SelectInvalidAction] def process(self, instance): @@ -60,3 +66,32 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): .format(instance.data) ) return [rop_node] + + @classmethod + def repair(cls, instance): + + if not cls.get_invalid(instance): + # Already fixed + print ("Not working") + return + + # Disable use asset handles + context = instance.context + create_context = context.data["create_context"] + instance_id = instance.data.get("instance_id") + if not instance_id: + cls.log.debug("'{}' must have instance id" + .format(instance)) + return + + created_instance = create_context.get_instance_by_id(instance_id) + if not instance_id: + cls.log.debug("Unable to find instance '{}' by id" + .format(instance)) + return + + created_instance.publish_attributes["CollectRopFrameRange"]["use_handles"] = False # noqa + + create_context.save_changes() + cls.log.debug("use asset handles is turned off for '{}'" + .format(instance)) From 82edc833390d686fcaf6a8827615a22034c0d3fa Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 19 Oct 2023 19:43:11 +0300 Subject: [PATCH 33/39] resolve hound --- openpype/hosts/houdini/plugins/publish/validate_frame_range.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py index 343cf3c5e4..6a66f3de9f 100644 --- a/openpype/hosts/houdini/plugins/publish/validate_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/validate_frame_range.py @@ -72,7 +72,6 @@ class ValidateFrameRange(pyblish.api.InstancePlugin): if not cls.get_invalid(instance): # Already fixed - print ("Not working") return # Disable use asset handles From 171dedb4f30d20507d67ac62c7272dffe0555432 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 23 Oct 2023 18:46:53 +0300 Subject: [PATCH 34/39] update collector order --- .../houdini/plugins/publish/collect_rop_frame_range.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index a368e77ff7..23717561e2 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -13,7 +13,9 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, """Collect all frames which would be saved from the ROP nodes""" hosts = ["houdini"] - order = pyblish.api.CollectorOrder + # This specific order value is used so that + # this plugin runs after CollectAnatomyInstanceData + order = pyblish.api.CollectorOrder + 0.5 label = "Collect RopNode Frame Range" use_asset_handles = True @@ -32,7 +34,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, attr_values = self.get_attr_values_from_data(instance.data) if attr_values.get("use_handles", self.use_asset_handles): - asset_data = instance.context.data["assetEntity"]["data"] + asset_data = instance.data["assetEntity"]["data"] handle_start = asset_data.get("handleStart", 0) handle_end = asset_data.get("handleEnd", 0) else: From 7bb81f7f6d712524c86c7bb414a0e8040132e104 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 23 Oct 2023 19:17:35 +0300 Subject: [PATCH 35/39] update collector order, follow BigRoys recommendation --- .../hosts/houdini/plugins/publish/collect_rop_frame_range.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py index 23717561e2..186244fedd 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py +++ b/openpype/hosts/houdini/plugins/publish/collect_rop_frame_range.py @@ -15,7 +15,7 @@ class CollectRopFrameRange(pyblish.api.InstancePlugin, hosts = ["houdini"] # This specific order value is used so that # this plugin runs after CollectAnatomyInstanceData - order = pyblish.api.CollectorOrder + 0.5 + order = pyblish.api.CollectorOrder + 0.499 label = "Collect RopNode Frame Range" use_asset_handles = True From 218c7f61c647159df119b19db381ed25b983de58 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 23 Oct 2023 19:23:00 +0300 Subject: [PATCH 36/39] update collector order for render product-types --- openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py | 4 +++- openpype/hosts/houdini/plugins/publish/collect_karma_rop.py | 4 +++- openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py | 4 +++- .../hosts/houdini/plugins/publish/collect_redshift_rop.py | 4 +++- openpype/hosts/houdini/plugins/publish/collect_vray_rop.py | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py index 28389c3b31..b489f83b29 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -20,7 +20,9 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): """ label = "Arnold ROP Render Products" - order = pyblish.api.CollectorOrder + 0.4 + # This specific order value is used so that + # this plugin runs after CollectRopFrameRange + order = pyblish.api.CollectorOrder + 0.4999 hosts = ["houdini"] families = ["arnold_rop"] diff --git a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py index b66dcde13f..fe0b8711fc 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_karma_rop.py @@ -24,7 +24,9 @@ class CollectKarmaROPRenderProducts(pyblish.api.InstancePlugin): """ label = "Karma ROP Render Products" - order = pyblish.api.CollectorOrder + 0.4 + # This specific order value is used so that + # this plugin runs after CollectRopFrameRange + order = pyblish.api.CollectorOrder + 0.4999 hosts = ["houdini"] families = ["karma_rop"] diff --git a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py index 3b7cf59f32..cc412f30a1 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -24,7 +24,9 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): """ label = "Mantra ROP Render Products" - order = pyblish.api.CollectorOrder + 0.4 + # This specific order value is used so that + # this plugin runs after CollectRopFrameRange + order = pyblish.api.CollectorOrder + 0.4999 hosts = ["houdini"] families = ["mantra_rop"] diff --git a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py index ca171a91f9..deb9eac971 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -24,7 +24,9 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): """ label = "Redshift ROP Render Products" - order = pyblish.api.CollectorOrder + 0.4 + # This specific order value is used so that + # this plugin runs after CollectRopFrameRange + order = pyblish.api.CollectorOrder + 0.4999 hosts = ["houdini"] families = ["redshift_rop"] diff --git a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py index b1ff4c1886..53072aebc6 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/openpype/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -24,7 +24,9 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): """ label = "VRay ROP Render Products" - order = pyblish.api.CollectorOrder + 0.4 + # This specific order value is used so that + # this plugin runs after CollectRopFrameRange + order = pyblish.api.CollectorOrder + 0.4999 hosts = ["houdini"] families = ["vray_rop"] From 18eedd478eb14d9405ff4a22d32654189c6016e6 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Mon, 23 Oct 2023 23:04:59 +0300 Subject: [PATCH 37/39] Update doc string Co-authored-by: Roy Nieterau --- openpype/hosts/houdini/api/lib.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index eab77ca19a..41cb4c76ee 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -572,10 +572,14 @@ def get_frame_data(node, handle_start=0, handle_end=0, log=None): """Get the frame data: start frame, end frame, steps, start frame with start handle and end frame with end handle. - This function uses Houdini node as the source of truth - therefore users are allowed to publish their desired frame range. + This function uses Houdini node's `trange`, `t1, `t2` and `t3` + parameters as the source of truth for the full inclusive frame + range to render, as such these are considered as the frame + range including the handles. - It also calculates frame start and end with handles. + The non-inclusive frame start and frame end without handles + are computed by subtracting the handles from the inclusive + frame range. Args: node(hou.Node) From 3761e3fc9a05a2fc978b6e34d696887fcf9e7a21 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 23 Oct 2023 23:06:43 +0300 Subject: [PATCH 38/39] resolve hound --- openpype/hosts/houdini/api/lib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 41cb4c76ee..115f4f3c17 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -572,9 +572,9 @@ def get_frame_data(node, handle_start=0, handle_end=0, log=None): """Get the frame data: start frame, end frame, steps, start frame with start handle and end frame with end handle. - This function uses Houdini node's `trange`, `t1, `t2` and `t3` - parameters as the source of truth for the full inclusive frame - range to render, as such these are considered as the frame + This function uses Houdini node's `trange`, `t1, `t2` and `t3` + parameters as the source of truth for the full inclusive frame + range to render, as such these are considered as the frame range including the handles. The non-inclusive frame start and frame end without handles From a65a275c5fb06d411482577da825b0eeb1bfc7f3 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 23 Oct 2023 23:10:43 +0300 Subject: [PATCH 39/39] update doc string --- openpype/hosts/houdini/api/lib.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 115f4f3c17..cadeaa8ed4 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -582,10 +582,12 @@ def get_frame_data(node, handle_start=0, handle_end=0, log=None): frame range. Args: - node(hou.Node) - handle_start(int) - handle_end(int) - log(logging.Logger) + node (hou.Node): ROP node to retrieve frame range from, + the frame range is assumed to be the frame range + *including* the start and end handles. + handle_start (int): Start handles. + handle_end (int): End handles. + log (logging.Logger): Logger to log to. Returns: dict: frame data for start, end, steps,