Skip to content

Commit

Permalink
allow render_rop to override ROP's frame range
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Jul 16, 2024
1 parent 35d2a5c commit 16a5a3c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions client/ayon_houdini/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,26 @@ def validate_fps():
return True


def render_rop(ropnode):
def render_rop(ropnode, frame_range=None):
"""Render ROP node utility for Publishing.
This renders a ROP node with the settings we want during Publishing.
Args:
ropnode (hou.RopNode): Node to render
frame_range (set): Copied from Houdini's help..
Sequence of 2 or 3 values, overrides the frame range and frame
increment to render. The first two values specify the start and
end frames, and the third value (if given) specifies the frame
increment. If no frame increment is given and the ROP node
doesn't specify a frame increment, then a value of 1 will be
used. If no frame range is given, and the ROP node doesn't
specify a frame range, then the current frame will be rendered.
"""
if frame_range is None:
# Empty set to fall to default. i.e. Don't override ROP's frame range.
frame_range = ()

# Print verbose when in batch mode without UI
verbose = not hou.isUIAvailable()

Expand All @@ -161,7 +176,8 @@ def render_rop(ropnode):
output_progress=verbose,
# Render only this node
# (do not render any of its dependencies)
ignore_inputs=True)
ignore_inputs=True,
frame_range=frame_range)
except hou.Error as exc:
# The hou.Error is not inherited from a Python Exception class,
# so we explicitly capture the houdini error, otherwise pyblish
Expand Down

0 comments on commit 16a5a3c

Please sign in to comment.