small fixes
This commit is contained in:
+11
-8
@@ -15,7 +15,7 @@ from vse_toolbox.constants import (EDITS, EDIT_SUFFIXES, MOVIES, MOVIE_SUFFIXES,
|
||||
from vse_toolbox.sequencer_utils import (clean_sequencer, import_edit, import_movie,
|
||||
import_sound, get_strips, get_channel_index, get_empty_channel, scale_clip_to_fit)
|
||||
|
||||
from vse_toolbox.bl_utils import (get_scene_settings, get_addon_prefs, get_scene_settings)
|
||||
from vse_toolbox.bl_utils import (get_scene_settings, get_addon_prefs, get_scene_settings, abspath)
|
||||
from vse_toolbox.file_utils import install_module, parse, find_last, expand
|
||||
|
||||
|
||||
@@ -368,16 +368,19 @@ class VSETB_OT_import_shots(Operator):
|
||||
|
||||
channel_index += 1
|
||||
|
||||
def get_preview_dir(self):
|
||||
preview_dir = Path(bpy.app.tempdir, 'previews')
|
||||
if bpy.data.filepath:
|
||||
preview_dir = Path(bpy.data.filepath).parent / 'previews'
|
||||
return preview_dir
|
||||
# def get_preview_dir(self):
|
||||
# preview_dir = Path(bpy.app.tempdir, 'previews')
|
||||
# if bpy.data.filepath:
|
||||
# preview_dir = Path(bpy.data.filepath).parent / 'previews'
|
||||
# return preview_dir
|
||||
|
||||
def download_preview(self, task_type, shot):
|
||||
prefs = get_addon_prefs()
|
||||
tracker = prefs.tracker
|
||||
|
||||
settings = get_scene_settings()
|
||||
project = settings.active_project
|
||||
|
||||
task = tracker.get_task(task_type.id or task_type.name, entity=shot)
|
||||
last_comment = tracker.get_last_comment_with_preview(task)
|
||||
if not last_comment:
|
||||
@@ -391,7 +394,7 @@ class VSETB_OT_import_shots(Operator):
|
||||
if shot_name.startswith(sequence_name):
|
||||
shot_name = shot_name.replace(sequence_name, '', 1)
|
||||
|
||||
preview_dir = self.get_preview_dir()
|
||||
preview_dir = abspath(project.import_shots.previews_folder)#self.get_preview_dir()
|
||||
|
||||
filepath = Path(preview_dir, f'{sequence_name}{shot_name}_{task_type.name}.{ext}')
|
||||
filepath.parent.mkdir(parents=True, exist_ok=True)
|
||||
@@ -621,7 +624,7 @@ class VSETB_OT_import_shots(Operator):
|
||||
tmp_dir = Path(gettempdir(), 'reviews')
|
||||
|
||||
if bpy.data.filepath and Path(project.import_shots.previews_folder) == tmp_dir:
|
||||
tmp_dir = '//sources'
|
||||
project.import_shots.previews_folder = '//sources'
|
||||
|
||||
if not bpy.data.filepath and project.import_shots.previews_folder == '//sources':
|
||||
project.import_shots.previews_folder = str(tmp_dir)
|
||||
|
||||
@@ -418,7 +418,11 @@ class WM_OT_split_view(Operator):
|
||||
scn = context.scene
|
||||
video_channels = [i for i, c in enumerate(scn.sequence_editor.channels) if 'Video' in c.name]
|
||||
|
||||
if len(video_channels) == 2 and len(preview_areas) == 1:
|
||||
if len(video_channels) < 2:
|
||||
self.report({"ERROR"}, 'You need two channels to split the view')
|
||||
return {"CANCELLED"}
|
||||
|
||||
if len(preview_areas) == 1:
|
||||
# Split area
|
||||
with bpy.context.temp_override(area=preview_areas[0]):
|
||||
bpy.ops.screen.area_split(direction="VERTICAL")
|
||||
@@ -427,7 +431,7 @@ class WM_OT_split_view(Operator):
|
||||
# Update areas
|
||||
preview_areas = self.get_preview_areas(context)
|
||||
|
||||
preview_areas[-1].spaces[0].display_channel = video_channels[-1]
|
||||
preview_areas[-1].spaces[0].display_channel = 0 #video_channels[-1]
|
||||
preview_areas[0].spaces[0].display_channel = video_channels[-2]
|
||||
|
||||
preview_areas[0].spaces[0].show_gizmo_navigate = False
|
||||
|
||||
@@ -37,11 +37,11 @@ class VSETB_OT_tracker_connect(Operator):
|
||||
settings = get_scene_settings()
|
||||
try:
|
||||
prefs.tracker.connect()
|
||||
self.report({'INFO'}, f'successfully login to {settings.tracker_name.title()}')
|
||||
self.report({'INFO'}, f'Successfully login to {settings.tracker_name.title()}')
|
||||
return {"FINISHED"}
|
||||
except Exception as e:
|
||||
print('e: ', e)
|
||||
self.report({'ERROR'}, f'Cannot connect to tracker.')
|
||||
self.report({'ERROR'}, f'Cannot connect to tracker, check login and password')
|
||||
return {"CANCELLED"}
|
||||
|
||||
|
||||
@@ -173,6 +173,7 @@ class VSETB_OT_load_projects(Operator):
|
||||
sequence.id = sequence_data['id']
|
||||
|
||||
project.metadata_types.clear()
|
||||
|
||||
for metadata_data in tracker.get_metadata_types(project_data):
|
||||
#pprint(metadata_data)
|
||||
metadata_type = project.metadata_types.add()
|
||||
|
||||
Reference in New Issue
Block a user