Blender Kitsu: Add Operator to Import Playblasts into Edit #274

Merged
Nick Alberelli merged 16 commits from TinyNick/blender-studio-pipeline:feature/import-playblasts into main 2024-04-03 17:38:07 +02:00
Showing only changes of commit 5963c924fe - Show all commits

View File

@ -2431,9 +2431,9 @@ class KITSU_OT_shot_image_sequence(bpy.types.Operator):
new_strip.name = f"{self.get_shot_name(strip)}{self.file_type.lower()}"
new_strip.colorspace_settings.name = new_strip.colorspace_settings.name
def get_shot_seq_directory(self, context, strip):
def get_shot_seq_directory(self, context, filepath):
addon_prefs = prefs.addon_prefs_get(context)
path_string = os.path.realpath(bpy.path.abspath(strip.filepath))
path_string = os.path.realpath(bpy.path.abspath(filepath))
path = Path(
path_string.replace(
addon_prefs.shot_playblast_root_dir, addon_prefs.frames_root_dir
@ -2457,8 +2457,11 @@ class KITSU_OT_shot_image_sequence(bpy.types.Operator):
if self.set_color_space:
self.set_scene_colorspace(context)
for strip in [strip for strip in context.selected_sequences if strip.type == 'MOVIE']:
directory = self.get_shot_seq_directory(context, strip)
for strip in [strip for strip in context.selected_sequences if strip.kitsu.shot_id != '']:
shot = Shot().by_id(strip.kitsu.shot_id)
# TODO pass task type as variable
filepath = shot.get_latest_playblast_file(context, "anim")
directory = self.get_shot_seq_directory(context, filepath)
if not directory.exists():
self.report({"ERROR"}, f"{directory._str} does not exist")
return {"CANCELLED"}