Import Shots for mu

This commit is contained in:
ChristopheSeux
2024-03-26 17:54:03 +01:00
parent ac14fe5ba9
commit dae9d55494
5 changed files with 159 additions and 19 deletions
+32 -5
View File
@@ -1,12 +1,12 @@
from os.path import expandvars
import bpy
from bpy.types import Operator
from bpy.props import (BoolProperty, StringProperty)
from vse_toolbox.sequencer_utils import (get_strips, rename_strips, set_channels,
get_channel_index, new_text_strip, get_strip_at)
from vse_toolbox.bl_utils import get_scene_settings
get_channel_index, new_text_strip, get_strip_at, get_channel_name)
from vse_toolbox.bl_utils import get_scene_settings, get_strip_settings
class VSETB_OT_rename(Operator):
@@ -269,6 +269,32 @@ class VSETB_OT_next_shot(Operator):
return {"FINISHED"}
class VSETB_OT_open_shot_dir(Operator):
bl_idname = "vse_toolbox.open_shot_dir"
bl_label = "Open Shot Dir"
bl_description = "Open Shot Dir"
bl_options = {"REGISTER", "UNDO"}
@classmethod
def poll(cls, context):
strip = context.active_sequence_strip
return strip and get_channel_name(strip) == 'Shots'
def execute(self, context):
strip = context.active_sequence_strip
settings = get_scene_settings()
project = settings.active_project
strip_settings = get_strip_settings()
format_data = {**settings.format_data, **project.format_data, **strip_settings.format_data}
shot_dir_template = expandvars(project.shot_dir_template)
shot_dir_path = shot_dir_template.format(**format_data)
bpy.ops.wm.path_open(filepath=shot_dir_path)
return {"FINISHED"}
addon_keymaps = []
def register_keymaps():
@@ -304,7 +330,8 @@ classes = (
VSETB_OT_set_stamps,
VSETB_OT_show_waveform,
VSETB_OT_previous_shot,
VSETB_OT_next_shot
VSETB_OT_next_shot,
VSETB_OT_open_shot_dir
)
def register():