Update "Armory Lod" object panel to Blender 2.9 layouts

This commit is contained in:
Moritz Brückner 2020-12-30 17:54:44 +01:00
parent a647263d1a
commit 257f295b27
2 changed files with 4 additions and 6 deletions

View file

@ -34,24 +34,22 @@ class ArmLodListItem(bpy.types.PropertyGroup):
class ARM_UL_LodList(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
# We could write some code to decide which icon to use here...
custom_icon = 'OBJECT_DATAMODE'
layout.use_property_split = False
# Make sure your code supports all 3 layout types
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.prop(item, "enabled_prop")
name = item.name
if name == '':
name = 'None'
row = layout.row()
row.label(text=name, icon=custom_icon)
row.label(text=name, icon='OBJECT_DATAMODE')
col = row.column()
col.alignment = 'RIGHT'
col.label(text="{:.2f}".format(item.screen_size_prop))
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label(text="", icon = custom_icon)
layout.label(text="", icon='OBJECT_DATAMODE')
class ArmLodListNewItem(bpy.types.Operator):
# Add a new item to the list

View file

@ -1850,7 +1850,7 @@ class ARM_PT_BakePanel(bpy.types.Panel):
layout.label(text="Warning! Overflow not yet supported")
class ArmGenLodButton(bpy.types.Operator):
'''Automatically generate LoD levels'''
"""Automatically generate LoD levels."""
bl_idname = 'arm.generate_lod'
bl_label = 'Auto Generate'