fix upload

pull/5/head
Christophe SEUX 2023-05-19 22:29:36 +02:00
parent beb85721a9
commit ba47d6c94f
2 changed files with 14 additions and 5 deletions

View File

@ -73,6 +73,8 @@ class VSETB_OT_render(Operator):
strip_settings = strip.vsetb_strip_settings strip_settings = strip.vsetb_strip_settings
strip_data = {**format_data, **strip_settings.format_data} strip_data = {**format_data, **strip_settings.format_data}
strip_render_path = project.render_strip_template.format(**strip_data) strip_render_path = project.render_strip_template.format(**strip_data)
render_strip(strip, strip_render_path) render_strip(strip, strip_render_path)
self.report({"INFO"}, f'Strips rendered in {time.perf_counter()-start_time} seconds') self.report({"INFO"}, f'Strips rendered in {time.perf_counter()-start_time} seconds')

View File

@ -1,4 +1,5 @@
import os
from pathlib import Path from pathlib import Path
import bpy import bpy
@ -297,6 +298,8 @@ class VSETB_OT_upload_to_tracker(Operator):
if settings.active_episode: if settings.active_episode:
episode = settings.active_episode.id episode = settings.active_episode.id
format_data = {**settings.format_data, **project.format_data}
tracker = prefs.tracker tracker = prefs.tracker
@ -305,10 +308,11 @@ class VSETB_OT_upload_to_tracker(Operator):
status = None status = None
for strip in get_strips(channel='Shots', selected_only=True): for strip in get_strips(channel='Shots', selected_only=True):
strip_settings = strip.vsetb_strip_settings
sequence_name = get_strip_sequence_name(strip) sequence_name = get_strip_sequence_name(strip)
shot_name = strip.name shot_name = strip.name
sequence = tracker.get_sequence(sequence_name, episode=episode) sequence = tracker.get_sequence(sequence_name, episode=episode)
metadata = strip.vsetb_strip_settings.metadata.to_dict() metadata = strip_settings.metadata.to_dict()
#print(metadata) #print(metadata)
if not sequence: if not sequence:
@ -329,7 +333,10 @@ class VSETB_OT_upload_to_tracker(Operator):
preview = None preview = None
if self.add_preview: 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) #print(preview)
if not preview.exists(): if not preview.exists():
print(f'The preview {preview} not exists') print(f'The preview {preview} not exists')
@ -348,12 +355,12 @@ class VSETB_OT_upload_to_tracker(Operator):
if self.custom_data: if self.custom_data:
metadata = strip.vsetb_strip_settings.metadata.to_dict() metadata = strip_settings.metadata.to_dict()
description = strip.vsetb_strip_settings.description description = strip_settings.description
tracker.update_data(shot, metadata, frames=strip.frame_final_duration, description=description) tracker.update_data(shot, metadata, frames=strip.frame_final_duration, description=description)
if self.casting: 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) tracker.update_casting(shot, casting)