From ba47d6c94fd4c065e618bdd10a6353668a6e6baa Mon Sep 17 00:00:00 2001 From: Christophe SEUX Date: Fri, 19 May 2023 22:29:36 +0200 Subject: [PATCH] fix upload --- operators/exports.py | 2 ++ operators/tracker.py | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/operators/exports.py b/operators/exports.py index 0d4cef8..2e9084b 100644 --- a/operators/exports.py +++ b/operators/exports.py @@ -73,6 +73,8 @@ class VSETB_OT_render(Operator): strip_settings = strip.vsetb_strip_settings strip_data = {**format_data, **strip_settings.format_data} strip_render_path = project.render_strip_template.format(**strip_data) + + render_strip(strip, strip_render_path) self.report({"INFO"}, f'Strips rendered in {time.perf_counter()-start_time} seconds') diff --git a/operators/tracker.py b/operators/tracker.py index be74aaf..ab3d83c 100644 --- a/operators/tracker.py +++ b/operators/tracker.py @@ -1,4 +1,5 @@ +import os from pathlib import Path import bpy @@ -297,6 +298,8 @@ class VSETB_OT_upload_to_tracker(Operator): if settings.active_episode: episode = settings.active_episode.id + format_data = {**settings.format_data, **project.format_data} + tracker = prefs.tracker @@ -305,10 +308,11 @@ class VSETB_OT_upload_to_tracker(Operator): status = None for strip in get_strips(channel='Shots', selected_only=True): + strip_settings = strip.vsetb_strip_settings sequence_name = get_strip_sequence_name(strip) shot_name = strip.name sequence = tracker.get_sequence(sequence_name, episode=episode) - metadata = strip.vsetb_strip_settings.metadata.to_dict() + metadata = strip_settings.metadata.to_dict() #print(metadata) if not sequence: @@ -329,7 +333,10 @@ class VSETB_OT_upload_to_tracker(Operator): preview = None if self.add_preview: - preview = Path(get_strip_render_path(strip, project.render_template)) + + strip_data = {**format_data, **strip_settings.format_data} + preview = project.render_strip_template.format(**strip_data) + preview = Path(os.path.abspath(bpy.path.abspath(preview))) #print(preview) if not preview.exists(): print(f'The preview {preview} not exists') @@ -348,12 +355,12 @@ class VSETB_OT_upload_to_tracker(Operator): if self.custom_data: - metadata = strip.vsetb_strip_settings.metadata.to_dict() - description = strip.vsetb_strip_settings.description + metadata = strip_settings.metadata.to_dict() + description = strip_settings.description tracker.update_data(shot, metadata, frames=strip.frame_final_duration, description=description) if self.casting: - casting = [{'asset_id': a.id, 'nb_occurences': a.instance} for a in strip.vsetb_strip_settings.casting] + casting = [{'asset_id': a.id, 'nb_occurences': a.instance} for a in strip_settings.casting] tracker.update_casting(shot, casting)