From 1cc9e0cd5f17a2a26f6a16d98e3ff7e6b780554d Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 8 Feb 2022 16:12:16 +0100 Subject: [PATCH 1/4] Explicitly collect correct frame name even in case of single frame render when `frameStart` is provided (cherry picked from commit 0f82a753560e362be731d0d14177c4f3edbf1db0) --- .../houdini/plugins/publish/collect_frames.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_frames.py b/openpype/hosts/houdini/plugins/publish/collect_frames.py index 8d21794c1bc..e3f5b609b85 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_frames.py +++ b/openpype/hosts/houdini/plugins/publish/collect_frames.py @@ -16,8 +16,17 @@ def process(self, instance): ropnode = instance[0] + start_frame = instance.data.get("frameStart", None) + end_frame = instance.data.get("frameEnd", None) + output_parm = lib.get_output_parameter(ropnode) - output = output_parm.eval() + if start_frame is not None: + # When rendering only a single frame still explicitly + # get the name for that particular frame instead of current frame + output = output_parm.evalAtFrame(start_frame) + else: + self.log.warning("Using current frame: {}".format(hou.frame())) + output = output_parm.eval() _, ext = os.path.splitext(output) file_name = os.path.basename(output) @@ -30,9 +39,6 @@ def process(self, instance): pattern = r"\w+\.(\d+)" + re.escape(ext) match = re.match(pattern, file_name) - start_frame = instance.data.get("frameStart", None) - end_frame = instance.data.get("frameEnd", None) - if match and start_frame is not None: # Check if frames are bigger than 1 (file collection) From fe449965798509d953b5df7ef6ed7df82ff1ae0d Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 8 Feb 2022 16:18:42 +0100 Subject: [PATCH 2/4] Fix import hou --- openpype/hosts/houdini/plugins/publish/collect_frames.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/hosts/houdini/plugins/publish/collect_frames.py b/openpype/hosts/houdini/plugins/publish/collect_frames.py index e3f5b609b85..b61c73240c2 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_frames.py +++ b/openpype/hosts/houdini/plugins/publish/collect_frames.py @@ -14,6 +14,8 @@ class CollectFrames(pyblish.api.InstancePlugin): def process(self, instance): + import hou + ropnode = instance[0] start_frame = instance.data.get("frameStart", None) From 2cf0da0255ea9d0feb014cafb4bb66ea8fd2d6a7 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 8 Feb 2022 16:19:19 +0100 Subject: [PATCH 3/4] Fix import hou --- openpype/hosts/houdini/plugins/publish/collect_frames.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/hosts/houdini/plugins/publish/collect_frames.py b/openpype/hosts/houdini/plugins/publish/collect_frames.py index b61c73240c2..5119abe055e 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_frames.py +++ b/openpype/hosts/houdini/plugins/publish/collect_frames.py @@ -1,6 +1,7 @@ import os import re +import hou import pyblish.api from openpype.hosts.houdini.api import lib From 21df44fe4b06e067efe11d5925fc8e9c3efc3b88 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 8 Feb 2022 16:19:48 +0100 Subject: [PATCH 4/4] Fix import hou --- openpype/hosts/houdini/plugins/publish/collect_frames.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/publish/collect_frames.py b/openpype/hosts/houdini/plugins/publish/collect_frames.py index 5119abe055e..32a5d3b969a 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_frames.py +++ b/openpype/hosts/houdini/plugins/publish/collect_frames.py @@ -15,8 +15,6 @@ class CollectFrames(pyblish.api.InstancePlugin): def process(self, instance): - import hou - ropnode = instance[0] start_frame = instance.data.get("frameStart", None)