add generic templates

This commit is contained in:
ChristopheSeux
2024-04-16 14:28:02 +02:00
parent 2960bab63d
commit 0055e0f39e
11 changed files with 343 additions and 116 deletions
+34 -2
View File
@@ -39,20 +39,52 @@ class VSETB_PT_main(VSETB_main, Panel):
# row.operator('vse_toolbox.load_projects', icon='FILE_REFRESH', text='', emboss=False)
def draw(self, context):
layout = self.layout
wm = context.window_manager
scn = context.scene
settings = get_scene_settings()
prefs = get_addon_prefs()
row = self.layout.row(align=False)
row = layout.row(align=True)
row.operator('vse_toolbox.load_projects', icon='FILE_REFRESH', text='', emboss=False)
row.separator(factor=0.5)
row.prop(settings, 'project_name', text='')
project = settings.active_project
if project and project.type == 'TVSHOW':
row.separator(factor=0.5)
row.prop(project, 'episode_name', text='')
row.separator(factor=0.5)
row.prop(project, "show_settings", icon="PREFERENCES", text='')
if project.show_settings:
box = layout.box()
split = box.split(factor=0.3)
name_col = split.column()
template_col = split.column()
row = name_col.row(align=True) # Padding
row.separator(factor=0.5)
row.label(text="Name")
row = template_col.row(align=True) # Padding
row.separator(factor=0.5)
row.label(text="Template")
row.operator("vse_toolbox.add_template", text="", icon='ADD', emboss=False)
for i, template in enumerate(project.templates):
row = name_col.row()
row.prop(template, "name", text="")
row = template_col.row(align=True)
subrow = row.row()
subrow.prop(template, "value", text="")
row.separator(factor=0.25)
row.operator("vse_toolbox.remove_template", text="", icon='REMOVE', emboss=False).index = i
# settings = get_scene_settings()
# prefs = get_addon_prefs()
@@ -173,7 +205,7 @@ class VSETB_PT_settings(VSETB_main, Panel):
class VSETB_PT_imports(VSETB_main, Panel):
bl_label = "Imports"
#bl_parent_id = "VSETB_PT_main"
bl_options = {'DEFAULT_CLOSED'}
#bl_options = {'DEFAULT_CLOSED'}
def draw_header_preset(self, context):
self.layout.operator('vse_toolbox.import_files', icon='IMPORT', text='', emboss=False)