I have an enum property that has 6 items and what I want is to arrange the 3 items in one and the other 3 items in the second row. Is it possible to set them?
Here is the code:
class NEW_PT_CUSTOM_73B8D(bpy.types.Panel):
bl_label = 'Custom'
bl_idname = 'SNA_PT_CUSTOM_73B8D'
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_context = ''
bl_category = 'Sell'
bl_order = 0
bl_ui_units_x=0
def draw(self, context):
layout = self.layout
# col = layout.column()
layout.prop(bpy.context.scene, 'my_enum', expand=True)
def register():
bpy.types.Scene.my_enum = bpy.props.EnumProperty(name='enum', description='', items=[('Rocket', 'Rocket', '', 0, 0), ('Jeep', 'Jeep', '', 0, 1), ('Truck', 'Truck', '', 0, 2), ('Car', 'Car', '', 0, 3), ('Bike', 'Bike', '', 0, 4), ('Plane', 'Plane', '', 0, 5)])
try: bpy.utils.register_class(NEW_PT_CUSTOM_73B8D)
except: pass
def unregister():
del bpy.types.Scene.my_enum
try: bpy.utils.unregister_class(NEW_PT_CUSTOM_73B8D)
except: pass
if __name__ == "__main__":
register()