Skip to content

Commit

Permalink
Updated update function to allow for sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamphues committed Aug 29, 2020
1 parent 328af0a commit 3ac6ca1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hooks/tk-houdini_scene_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from tank import Hook

import hou
import re


class BreakdownSceneOperations(Hook):
Expand Down Expand Up @@ -87,6 +88,7 @@ def update(self, items):
generated by the scan_scene hook above. The path key now holds
the that each node should be updated *to* rather than the current path.
"""
frame_pattern = re.compile("(%0(\d)d)")

engine = self.parent.engine

Expand All @@ -111,6 +113,13 @@ def update(self, items):

# update the file node file parameter to the new path
if node_type == 'file':

frame_match = re.search(frame_pattern, file_path)

if frame_match:
full_frame_spec = frame_match.group(1)
padding = frame_match.group(2)
file_path = file_path.replace(full_frame_spec, "$F%s" % (padding,))

file_node = hou.node(node_path)
engine.log_debug(
Expand Down

0 comments on commit 3ac6ca1

Please sign in to comment.