Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2676 from BigRoy/hou_fix_single_frame_render
Browse files Browse the repository at this point in the history
Houdini Explicitly collect correct frame name even in case of single frame render when `frameStart` is provided
  • Loading branch information
antirotor authored Feb 11, 2022
2 parents 897ce52 + 21df44f commit a28ffb1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions openpype/hosts/houdini/plugins/publish/collect_frames.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import re

import hou
import pyblish.api
from openpype.hosts.houdini.api import lib

Expand All @@ -16,8 +17,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)
Expand All @@ -30,9 +40,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)
Expand Down

0 comments on commit a28ffb1

Please sign in to comment.