diff --git a/operators/operators.py b/operators/operators.py index 4be1d13..fb7e026 100644 --- a/operators/operators.py +++ b/operators/operators.py @@ -621,6 +621,10 @@ class VSETB_OT_load_projects(Operator): metadata_type.name = metadata_data['name'] metadata_type.field_name = metadata_data['field_name'] #metadata_type['choices'] = metadata_data['choices'] + + if prefs.sort_metadata_items: + metadata_data['choices'].sort() + for choice in metadata_data['choices']: choice_item = metadata_type.choices.add() choice_item.name = choice diff --git a/preferences.py b/preferences.py index 2101441..908896d 100644 --- a/preferences.py +++ b/preferences.py @@ -100,6 +100,7 @@ class VSETB_Prefs(AddonPreferences): trackers : PointerProperty(type=Trackers) expand_settings: BoolProperty(default=False) config_path : StringProperty(subtype='FILE_PATH') + sort_metadata_items : BoolProperty(default=True) @property def tracker(self): @@ -111,26 +112,27 @@ class VSETB_Prefs(AddonPreferences): layout = self.layout + layout.prop(self, 'config_path', text='Config Path') + layout.prop(self, "sort_metadata_items", text='Sort Metadata Items') + col = layout.column(align=True) box = col.box() row = box.row(align=True) icon = "DISCLOSURE_TRI_DOWN" if self.expand_settings else "DISCLOSURE_TRI_RIGHT" row.prop(self, 'expand_settings', icon=icon, emboss=False, text='') row.label(icon='PREFERENCES') - row.label(text='Settings') + row.label(text='Tracker') subrow = row.row() subrow.alignment = 'RIGHT' subrow.operator("vse_toolbox.reload_addon", text='Reload Addon') if self.expand_settings: - box.prop(self, 'config_path', text='Config Path') box.prop(settings, 'tracker_name', text='Tracker') self.tracker.draw_prefs(box) #row = box.row() box.operator("vse_toolbox.tracker_connect", text='Connect') - classes = [ Trackers, VSETB_Prefs, diff --git a/properties.py b/properties.py index 19e85b6..fdef189 100644 --- a/properties.py +++ b/properties.py @@ -124,6 +124,7 @@ class SpreadsheetCell(PropertyGroup): enabled : BoolProperty(default=True) field_name : StringProperty() type : EnumProperty(items=[(t, t, "") for t in ('METADATA', 'SHOT', 'ASSET_TYPE')]) + #sort : BoolProperty(default=True) class AssetType(PropertyGroup): @@ -175,6 +176,7 @@ class SpreadsheetOptions(PropertyGroup): open_folder : BoolProperty(default=False) show_settings : BoolProperty(default=False) + class Project(PropertyGroup): id : StringProperty(default='')