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 #336 from tokejepsen/2.x/feature/editorial_support…
Browse files Browse the repository at this point in the history
…_middle_shots

Support publishing a subset of shots
  • Loading branch information
mkolar authored Jul 8, 2020
2 parents fe6ea0e + 57f795f commit e863eec
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pype/plugins/standalonepublisher/publish/collect_shots.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,36 @@ def process(self, instance):
asset_entity = instance.context.data["assetEntity"]
asset_name = asset_entity["name"]

# Ask user for sequence start. Usually 10:00:00:00.
sequence_start_frame = 900000

# Project specific prefix naming. This needs to be replaced with some
# options to be more flexible.
asset_name = asset_name.split("_")[0]

instances = []
for track in tracks:
track_start_frame = (
abs(track.source_range.start_time.value) - sequence_start_frame
)
for child in track.each_child():

# Transitions are ignored, because Clips have the full frame
# range.
if isinstance(child, otio.schema.transition.Transition):
continue

if child.name is None:
continue

# Hardcoded to expect a shot name of "[name].[extension]"
child_name = os.path.splitext(child.name)[0].lower()
name = f"{asset_name}_{child_name}"

frame_start = child.range_in_parent().start_time.value
frame_end = child.range_in_parent().end_time_inclusive().value
frame_start = track_start_frame
frame_start += child.range_in_parent().start_time.value
frame_end = track_start_frame
frame_end += child.range_in_parent().end_time_inclusive().value

label = f"{name} (framerange: {frame_start}-{frame_end})"
instances.append(
Expand Down

0 comments on commit e863eec

Please sign in to comment.