parent
7f60aae277
commit
72455e50fc
|
@ -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,
|
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)
|
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, abspath)
|
from vse_toolbox.bl_utils import (get_scene_settings, get_addon_prefs, get_scene_settings)
|
||||||
from vse_toolbox.file_utils import install_module, parse, find_last, expand
|
from vse_toolbox.file_utils import install_module, parse, find_last, expand
|
||||||
|
|
||||||
|
|
||||||
|
@ -368,19 +368,16 @@ class VSETB_OT_import_shots(Operator):
|
||||||
|
|
||||||
channel_index += 1
|
channel_index += 1
|
||||||
|
|
||||||
# def get_preview_dir(self):
|
def get_preview_dir(self):
|
||||||
# preview_dir = Path(bpy.app.tempdir, 'previews')
|
preview_dir = Path(bpy.app.tempdir, 'previews')
|
||||||
# if bpy.data.filepath:
|
if bpy.data.filepath:
|
||||||
# preview_dir = Path(bpy.data.filepath).parent / 'previews'
|
preview_dir = Path(bpy.data.filepath).parent / 'previews'
|
||||||
# return preview_dir
|
return preview_dir
|
||||||
|
|
||||||
def download_preview(self, task_type, shot):
|
def download_preview(self, task_type, shot):
|
||||||
prefs = get_addon_prefs()
|
prefs = get_addon_prefs()
|
||||||
tracker = prefs.tracker
|
tracker = prefs.tracker
|
||||||
|
|
||||||
settings = get_scene_settings()
|
|
||||||
project = settings.active_project
|
|
||||||
|
|
||||||
task = tracker.get_task(task_type.id or task_type.name, entity=shot)
|
task = tracker.get_task(task_type.id or task_type.name, entity=shot)
|
||||||
last_comment = tracker.get_last_comment_with_preview(task)
|
last_comment = tracker.get_last_comment_with_preview(task)
|
||||||
if not last_comment:
|
if not last_comment:
|
||||||
|
@ -394,7 +391,7 @@ class VSETB_OT_import_shots(Operator):
|
||||||
if shot_name.startswith(sequence_name):
|
if shot_name.startswith(sequence_name):
|
||||||
shot_name = shot_name.replace(sequence_name, '', 1)
|
shot_name = shot_name.replace(sequence_name, '', 1)
|
||||||
|
|
||||||
preview_dir = abspath(project.import_shots.previews_folder)#self.get_preview_dir()
|
preview_dir = self.get_preview_dir()
|
||||||
|
|
||||||
filepath = Path(preview_dir, f'{sequence_name}{shot_name}_{task_type.name}.{ext}')
|
filepath = Path(preview_dir, f'{sequence_name}{shot_name}_{task_type.name}.{ext}')
|
||||||
filepath.parent.mkdir(parents=True, exist_ok=True)
|
filepath.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
@ -624,7 +621,7 @@ class VSETB_OT_import_shots(Operator):
|
||||||
tmp_dir = Path(gettempdir(), 'reviews')
|
tmp_dir = Path(gettempdir(), 'reviews')
|
||||||
|
|
||||||
if bpy.data.filepath and Path(project.import_shots.previews_folder) == tmp_dir:
|
if bpy.data.filepath and Path(project.import_shots.previews_folder) == tmp_dir:
|
||||||
project.import_shots.previews_folder = '//sources'
|
tmp_dir = '//sources'
|
||||||
|
|
||||||
if not bpy.data.filepath and 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)
|
project.import_shots.previews_folder = str(tmp_dir)
|
||||||
|
|
|
@ -418,11 +418,7 @@ class WM_OT_split_view(Operator):
|
||||||
scn = context.scene
|
scn = context.scene
|
||||||
video_channels = [i for i, c in enumerate(scn.sequence_editor.channels) if 'Video' in c.name]
|
video_channels = [i for i, c in enumerate(scn.sequence_editor.channels) if 'Video' in c.name]
|
||||||
|
|
||||||
if len(video_channels) < 2:
|
if len(video_channels) == 2 and len(preview_areas) == 1:
|
||||||
self.report({"ERROR"}, 'You need two channels to split the view')
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
if len(preview_areas) == 1:
|
|
||||||
# Split area
|
# Split area
|
||||||
with bpy.context.temp_override(area=preview_areas[0]):
|
with bpy.context.temp_override(area=preview_areas[0]):
|
||||||
bpy.ops.screen.area_split(direction="VERTICAL")
|
bpy.ops.screen.area_split(direction="VERTICAL")
|
||||||
|
@ -431,7 +427,7 @@ class WM_OT_split_view(Operator):
|
||||||
# Update areas
|
# Update areas
|
||||||
preview_areas = self.get_preview_areas(context)
|
preview_areas = self.get_preview_areas(context)
|
||||||
|
|
||||||
preview_areas[-1].spaces[0].display_channel = 0 #video_channels[-1]
|
preview_areas[-1].spaces[0].display_channel = video_channels[-1]
|
||||||
preview_areas[0].spaces[0].display_channel = video_channels[-2]
|
preview_areas[0].spaces[0].display_channel = video_channels[-2]
|
||||||
|
|
||||||
preview_areas[0].spaces[0].show_gizmo_navigate = False
|
preview_areas[0].spaces[0].show_gizmo_navigate = False
|
||||||
|
|
|
@ -37,11 +37,11 @@ class VSETB_OT_tracker_connect(Operator):
|
||||||
settings = get_scene_settings()
|
settings = get_scene_settings()
|
||||||
try:
|
try:
|
||||||
prefs.tracker.connect()
|
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"}
|
return {"FINISHED"}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('e: ', e)
|
print('e: ', e)
|
||||||
self.report({'ERROR'}, f'Cannot connect to tracker, check login and password')
|
self.report({'ERROR'}, f'Cannot connect to tracker.')
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
|
|
||||||
|
@ -173,7 +173,6 @@ class VSETB_OT_load_projects(Operator):
|
||||||
sequence.id = sequence_data['id']
|
sequence.id = sequence_data['id']
|
||||||
|
|
||||||
project.metadata_types.clear()
|
project.metadata_types.clear()
|
||||||
|
|
||||||
for metadata_data in tracker.get_metadata_types(project_data):
|
for metadata_data in tracker.get_metadata_types(project_data):
|
||||||
#pprint(metadata_data)
|
#pprint(metadata_data)
|
||||||
metadata_type = project.metadata_types.add()
|
metadata_type = project.metadata_types.add()
|
||||||
|
|
|
@ -74,14 +74,14 @@ class Kitsu(Tracker):
|
||||||
if not gazu.client.host_is_up():
|
if not gazu.client.host_is_up():
|
||||||
print('Error: Kitsu Host is down')
|
print('Error: Kitsu Host is down')
|
||||||
|
|
||||||
#try:
|
try:
|
||||||
print(f'Info: Log in to kitsu as {login}')
|
print(f'Info: Log in to kitsu as {login}')
|
||||||
res = gazu.log_in(login, password)
|
res = gazu.log_in(login, password)
|
||||||
LOGIN = login
|
LOGIN = login
|
||||||
print(f'Info: successfully login to Kitsu as {res["user"]["full_name"]}')
|
print(f'Info: successfully login to Kitsu as {res["user"]["full_name"]}')
|
||||||
return res['user']
|
return res['user']
|
||||||
#except Exception as e:
|
except Exception as e:
|
||||||
# print(f'Error: {traceback.format_exc()}')
|
print(f'Error: {traceback.format_exc()}')
|
||||||
|
|
||||||
def get_id(self, data):
|
def get_id(self, data):
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
|
@ -148,14 +148,13 @@ class Kitsu(Tracker):
|
||||||
|
|
||||||
def get_metadata_types(self, project=None):
|
def get_metadata_types(self, project=None):
|
||||||
project = self.get_project(project)
|
project = self.get_project(project)
|
||||||
|
metadatas = []
|
||||||
|
|
||||||
try :
|
for metadata in gazu.project.all_metadata_descriptors(project):
|
||||||
metadatas = gazu.project.all_metadata_descriptors(project)
|
if metadata['name']:
|
||||||
except gazu.exception.NotAllowedException:
|
metadatas.append(metadata)
|
||||||
print('No autorized to fetch metadata')
|
|
||||||
return []
|
|
||||||
|
|
||||||
return [m for m in metadatas if m['name']]
|
return metadatas
|
||||||
|
|
||||||
def get_task_status(self, status=None):
|
def get_task_status(self, status=None):
|
||||||
status_id = self.get_id(status)
|
status_id = self.get_id(status)
|
||||||
|
|
|
@ -53,9 +53,6 @@ class VSETB_PT_main(VSETB_main, Panel):
|
||||||
|
|
||||||
project = settings.active_project
|
project = settings.active_project
|
||||||
|
|
||||||
if not project:
|
|
||||||
return
|
|
||||||
|
|
||||||
if project and project.type == 'TVSHOW':
|
if project and project.type == 'TVSHOW':
|
||||||
row.separator(factor=0.5)
|
row.separator(factor=0.5)
|
||||||
row.prop(project, 'episode_name', text='')
|
row.prop(project, 'episode_name', text='')
|
||||||
|
|
Loading…
Reference in New Issue