add comments panel

This commit is contained in:
2024-02-14 14:33:54 +01:00
parent 571f7d5807
commit 10f9824ac2
4 changed files with 120 additions and 46 deletions
+83 -35
View File
@@ -216,14 +216,22 @@ class VSETB_PT_exports(VSETB_main, Panel):
layout.operator('vse_toolbox.export_edl', text='Export edl', icon='SEQ_SEQUENCER')
class VSETB_PT_casting(VSETB_main, Panel):
bl_label = "Casting"
class VSETB_PT_tracker(VSETB_main, Panel):
bl_label = "Tracker"
bl_parent_id = "VSETB_PT_main"
def draw_header_preset(self, context):
active_strip = context.scene.sequence_editor.active_strip
self.layout.label(text=active_strip.name)
def draw(self, context):
return
class VSETB_PT_casting(VSETB_main, Panel):
bl_label = "Casting"
bl_parent_id = "VSETB_PT_tracker"
@classmethod
def poll(cls, context):
strip = context.scene.sequence_editor.active_strip
@@ -277,50 +285,88 @@ class VSETB_PT_casting(VSETB_main, Panel):
class VSETB_PT_metadata(VSETB_main, Panel):
bl_label = "Shot Metadata"
bl_parent_id = "VSETB_PT_casting"
#bl_options = {"DEFAULT_CLOSED"}
bl_parent_id = "VSETB_PT_tracker"
@classmethod
def poll(cls, context):
return context.scene.sequence_editor.active_strip and get_scene_settings().active_project
def draw(self, context):
strip_settings = get_strip_settings()
project = get_scene_settings().active_project
layout = self.layout
row = layout.row(align=True)
label_col = row.column(align=True)
label_col.alignment = 'RIGHT'
field_col = row.column(align=True)
for metadata_type in project.metadata_types:
if metadata_type.entity_type != 'SHOT':
continue
metadata_key = metadata_type.field_name
metadata_label = metadata_key.title()
label_col.label(text=metadata_label)
field_row = field_col.row(align=True)
field_row.separator()
if metadata_type.choices:
metadata_value = getattr(strip_settings.metadata, metadata_key)
icon = 'LAYER_USED'
if metadata_value:
if metadata_value in metadata_type.choices:
icon = 'DOT'
else:
icon = 'ADD'
field_row.prop_search(strip_settings.metadata, metadata_key, metadata_type, 'choices',
results_are_suggestions=True, icon=icon, text='')
else:
field_row.prop(strip_settings.metadata, metadata_key, text='')
class VSETB_PT_comments(VSETB_main, Panel):
bl_label = "Comments"
bl_parent_id = "VSETB_PT_tracker"
@classmethod
def poll(cls, context):
return context.scene.sequence_editor.active_strip and get_scene_settings().active_project
def draw(self, context):
layout = self.layout
scn = context.scene
active_strip = scn.sequence_editor.active_strip
if not active_strip:
return
settings = get_scene_settings()
row = layout.row(align=True)
label_col = row.column(align=True)
label_col.alignment = 'RIGHT'
field_col = row.column(align=True)
strip_settings = get_strip_settings()
project = get_scene_settings().active_project
project = settings.active_project
if not project:
return
col = layout.column(align=True)
col.prop(strip_settings, 'description', text='DESCRIPTION')
for task_type in project.task_types:
if not hasattr(strip_settings.tasks, task_type.name):
continue
for metadata_type in project.metadata_types:
if metadata_type.entity_type == 'SHOT':
#row = layout.row(align=False)
metadata_key = metadata_type.field_name
metadata_label = metadata_key.upper()
label_col.label(text=task_type.name)
if metadata_type.choices:
metadata_value = getattr(strip_settings.metadata, metadata_key)
icon = 'LAYER_USED'
if metadata_value:
if metadata_value in metadata_type.choices:
icon = 'DOT'
else:
icon = 'ADD'
row = field_col.row(align=True)
row.separator()
sub = row.row(align=True)
sub.alignment = 'LEFT'
sub.scale_x = 0.15
col.prop_search(strip_settings.metadata, metadata_key, metadata_type, 'choices',
results_are_suggestions=True, icon=icon, text=metadata_label)
else:
col.prop(strip_settings.metadata, metadata_key, text=metadata_label)
sub.prop(task_type, 'color', text='')
sub.enabled = False
row.prop(getattr(strip_settings.tasks, task_type.name), 'comment', text='')
#row.operator('vse_toolbox.copy_metadata', icon='PASTEDOWN', text='', emboss=False).metadata = metadata_key
def context_menu_prop(self, context):
if not hasattr(context, 'button_prop') or context.space_data.type != 'SEQUENCE_EDITOR':
@@ -343,8 +389,10 @@ classes = (
VSETB_PT_main,
VSETB_PT_imports,
VSETB_PT_sequencer,
VSETB_PT_tracker,
VSETB_PT_casting,
VSETB_PT_metadata,
VSETB_PT_comments,
VSETB_PT_presets,
VSETB_PT_exports,
VSETB_PT_strip