add instance in panels

pull/5/head
Clément Ducarteron 2023-03-21 10:22:17 +01:00
parent 9bc6f0cd2d
commit 3cc254bdc9
3 changed files with 14 additions and 12 deletions

View File

@ -271,6 +271,7 @@ class VSETB_OT_load_assets(Operator):
'props':'OBJECT_DATAMODE',
'sets':'SMOOTHCURVE',
}
#TODO Mettre la preview dans le popup search
return [(e.norm_name, e.norm_name.title(), '', icons[e.asset_type], i) for i, e in enumerate(items)]
# return [(e.norm_name, e.norm_name.title(), '', ASSET_PREVIEWS[e.preview].icon_id, i) for i, e in enumerate(items)]

View File

@ -58,7 +58,6 @@ class VSETB_PT_main(VSETB_main, Panel):
row.operator('sequencer.import_files', text='Import', icon='IMPORT')
# TODO FAIRE DES VRAIS OPS
row.operator('sequencer.export_csv', text='Export', icon='EXPORT')
op = col.operator('sequencer.strips_render', text='Render Strips', icon='RENDER_ANIMATION')

View File

@ -45,15 +45,6 @@ def get_tracker_items(self, context):
return [(norm_str(a.name, format=str.upper), a.name, "", i) for i, a in enumerate(TRACKERS)]
class Episode(PropertyGroup):
id : StringProperty(default='')
@property
def active(self):
settings = get_settings()
return self.get(settings.project_name)
class Asset(PropertyGroup):
name : StringProperty(default='')
id : StringProperty(default='')
@ -66,8 +57,18 @@ class Asset(PropertyGroup):
def __iter__(self):
return (getattr(self, p) for p in self.bl_rna.properties.keys() if p not in ('rna_type', 'name'))
class AssetCasting(Asset):
pass
instance : IntProperty(default=1)
class Episode(PropertyGroup):
id : StringProperty(default='')
@property
def active(self):
settings = get_settings()
return self.get(settings.project_name)
class Project(PropertyGroup):
@ -119,9 +120,10 @@ class VSETB_UL_casting(UIList):
# Make sure your code supports all 3 layout types
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(**params)
split = layout.split(factor=0.7)
split = layout.split(factor=0.6)
split.label(text=f"{item.norm_name.title()}")
split.label(text=f"{item.asset_type.title()}")
split.prop(item, 'instance', text='')
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'