diff --git a/operators/sequencer.py b/operators/sequencer.py index 82aabfa..faa2e58 100644 --- a/operators/sequencer.py +++ b/operators/sequencer.py @@ -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"} diff --git a/operators/tracker.py b/operators/tracker.py index d416331..c087485 100644 --- a/operators/tracker.py +++ b/operators/tracker.py @@ -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')