mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #2676 from BigRoy/hou_fix_single_frame_render
Houdini Explicitly collect correct frame name even in case of single frame render when `frameStart` is provided
This commit is contained in:
commit
a28ffb1588
1 changed files with 11 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import re
|
||||
|
||||
import hou
|
||||
import pyblish.api
|
||||
from openpype.hosts.houdini.api import lib
|
||||
|
||||
|
|
@ -16,8 +17,17 @@ class CollectFrames(pyblish.api.InstancePlugin):
|
|||
|
||||
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 +40,6 @@ class CollectFrames(pyblish.api.InstancePlugin):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue