fix metadta when changing project
parent
08885f8c59
commit
0a8e5f9c79
|
@ -338,7 +338,8 @@ class VSETB_OT_load_projects(Operator):
|
|||
asset_type = project.asset_types.add()
|
||||
asset_type.name = asset_type_data['name']
|
||||
|
||||
project.set_strip_metadata()
|
||||
if settings.active_project:
|
||||
settings.active_project.set_strip_metadata()
|
||||
|
||||
bpy.ops.vse_toolbox.load_assets()
|
||||
|
||||
|
|
|
@ -44,6 +44,9 @@ def on_project_updated(self, context):
|
|||
print('Update active Project')
|
||||
|
||||
bpy.ops.vse_toolbox.load_assets()
|
||||
|
||||
if settings.active_project:
|
||||
settings.active_project.set_strip_metadata()
|
||||
|
||||
def get_tracker_items(self, context):
|
||||
return [(norm_str(a.name, format=str.upper), a.name, "", i) for i, a in enumerate(TRACKERS)]
|
||||
|
@ -135,7 +138,15 @@ class Project(PropertyGroup):
|
|||
metadata_types : CollectionProperty(type=MetadataType)
|
||||
type : StringProperty()
|
||||
|
||||
def set_strip_metadata(self):
|
||||
def set_strip_metadata(self):
|
||||
|
||||
# Clear Metadatas
|
||||
for attr in list(Metadata.__annotations__.keys()):
|
||||
if hasattr(Metadata, attr):
|
||||
delattr(Metadata, attr)
|
||||
del Metadata.__annotations__[attr]
|
||||
|
||||
|
||||
for metadata_type in self.metadata_types:
|
||||
prop_name = metadata_type.name
|
||||
if metadata_type['choices']:
|
||||
|
|
Loading…
Reference in New Issue