Skip to content

Commit

Permalink
support frames-to-fix in ExtractROP
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Jul 16, 2024
1 parent 985b369 commit 4d47fc3
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions client/ayon_houdini/plugins/publish/extract_rop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import hou
import clique

import pyblish.api

Expand Down Expand Up @@ -33,9 +34,32 @@ def process(self, instance: pyblish.api.Instance):
)
ext = ext.lstrip(".")

self.log.debug(f"Rendering {rop_node.path()} to {first_file}..")
last_published = instance.data.get("last_version_published_files")

render_rop(rop_node)
self.log.debug(
"Rendering {node_path} to {location}".format(
node_path=rop_node.path(),
location=instance.data['stagingDir'] if isinstance(files, (list, tuple)) else files
)
)
if last_published and len(last_published) > 1:
# Render only frames to fix
frames_to_fix = clique.parse(instance.data["frames_to_fix"], "{ranges}")
for frame_range in frames_to_fix.separate():
frame_range = list(frame_range)
self.log.debug(
"Rendering frames to fix [{f1}, {f2}]".format(
f1=frame_range[0],
f2=frame_range[-1]
)
)
frame_range = (
int(frame_range[0]), int(frame_range[-1]), instance.data["byFrameStep"]
)
render_rop(rop_node, frame_range=frame_range)

else:
render_rop(rop_node)
self.validate_expected_frames(instance)

# In some cases representation name is not the the extension
Expand Down

0 comments on commit 4d47fc3

Please sign in to comment.