Hi I have the following code:
import bpy
from bpy.types import Panel
from bpy.app.translations import pgettext_iface as iface_
class BasicMenu(bpy.types.Menu):
bl_idname = "OBJECT_MT_Modifier"
bl_label = "Modifier"
bl_region_type = 'WINDOW'
def draw(self, context):
layout = self.layout
ob = context.object
layout.operator_menu_enum("object.modifier_add", "type")
for md in ob.modifiers:
box = layout.template_modifier(md)
if box:
# match enum type to our functions, avoids a lookup table.
getattr(self, md.type)(box, ob, md)
bpy.utils.register_class(BasicMenu)
# test call to display immediately.
bpy.ops.wm.call_menu(name="OBJECT_MT_Modifier")
Which produces this:
How do I get it so that it shows up more like the modifier tab?