fix episode restore

pull/5/head
“christopheseux” 2023-05-04 12:24:48 +02:00
parent 706fcb2ee1
commit 2d24e3da7f
2 changed files with 18 additions and 3 deletions

View File

@ -116,9 +116,10 @@ class VSETB_OT_set_sequencer(Operator):
scn = context.scene
set_channels()
movie = get_strips(channel='Movie')
if movie:
movie = movie[0]
movies = get_strips(channel='Movie')
movie = None
if movies:
movie = movies[0]
movie.transform.scale_x = movie.transform.scale_y = 1
elem = movie.strip_elem_from_frame(scn.frame_current)
scn.render.resolution_x = elem.orig_width
@ -135,6 +136,12 @@ class VSETB_OT_set_sequencer(Operator):
scn.render.ffmpeg.audio_codec = 'MP3'
scn.render.ffmpeg.audio_mixrate = 44100
scn.render.ffmpeg.audio_bitrate = 128
shots = get_strips(channel='Shots')
if shots:
scn.frame_end = shots[-1].frame_final_end -1
elif movie:
scn.frame_end = movie.frame_final_end -1
return {"FINISHED"}

View File

@ -106,6 +106,10 @@ class VSETB_OT_load_projects(Operator):
tracker = prefs.tracker
old_project_name = settings.project_name.replace(' ', '_').upper()
old_episode_name = None
if settings.active_project:
old_episode_name = settings.active_project.episode_name.replace(' ', '_').upper()
settings.projects.clear()
tracker.connect()
@ -157,6 +161,10 @@ class VSETB_OT_load_projects(Operator):
if project.name.replace(' ', '_').upper() == old_project_name:
settings.project_name = project.name
for episode in project.episodes:
if episode.name.replace(' ', '_').upper() == old_episode_name:
project.episode_name = episode.name
bpy.ops.vse_toolbox.load_settings()
#else:
# print('Could Not restore Project Name')