copy metadata

This commit is contained in:
“christopheseux”
2023-04-25 18:43:04 +02:00
parent ef4f8f527b
commit 5884d278da
4 changed files with 79 additions and 12 deletions
+40 -9
View File
@@ -57,6 +57,34 @@ class VSETB_OT_tracker_connect(Operator):
return {"CANCELLED"}
class VSETB_OT_copy_metadata(Operator):
bl_idname = "vse_toolbox.copy_metadata"
bl_label = "Copy metadata to selected"
bl_description = "Copy Metadata to selected strips"
metadata : StringProperty()
@classmethod
def poll(cls, context):
return context.selected_sequences and context.active_sequence_strip
def execute(self, context):
prefs = get_addon_prefs()
settings = get_scene_settings()
metadata = self.metadata.lower()
active_strip = context.active_sequence_strip
metadata_value = getattr(active_strip.vsetb_strip_settings.metadata, metadata)
for strip in context.selected_sequences:
if strip == context.active_sequence_strip:
continue
setattr(strip.vsetb_strip_settings.metadata, metadata, metadata_value)
return {"FINISHED"}
class VSETB_OT_export_spreadsheet(Operator):
bl_idname = "vse_toolbox.export_spreadsheet"
bl_label = "Export Spreadsheet"
@@ -1218,16 +1246,18 @@ class VSETB_OT_paste_casting(Operator):
return {"CANCELLED"}
casting_datas = json.loads(CASTING_BUFFER.read_text())
for casting_item in casting_datas:
for strip in context.selected_sequences:
strip_settings = strip.vsetb_strip_settings
if strip_settings.casting.get(casting_item['name']):
continue
for strip in context.selected_sequences:
strip_settings = strip.vsetb_strip_settings
for casting_data in casting_datas:
item = strip.vsetb_strip_settings.casting.add()
for k, v in casting_item.items():
setattr(item, k, v)
item.name = casting_data['name']
item.id = casting_data['id']
item['_name'] = casting_data['_name']
strip_settings.casting.update()
@@ -1376,7 +1406,8 @@ classes = (
VSETB_OT_tracker_connect,
VSETB_OT_set_stamps,
VSETB_OT_upload_to_tracker,
VSETB_OT_show_waveform
VSETB_OT_show_waveform,
VSETB_OT_copy_metadata
)
def register():