4 class PhysicButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
7 __context__ = "physics"
9 def poll(self, context):
11 return (ob and ob.type == 'MESH')
13 class PHYSICS_PT_softbody(PhysicButtonsPanel):
14 __idname__ = "PHYSICS_PT_softbody"
15 __label__ = "Soft Body"
17 def draw(self, context):
19 md = context.soft_body
22 split = layout.split()
23 split.operator_context = "EXEC_DEFAULT"
26 # remove modifier + settings
27 split.set_context_pointer("modifier", md)
28 split.itemO("OBJECT_OT_modifier_remove", text="Remove")
30 row = split.row(align=True)
31 row.itemR(md, "render", text="")
32 row.itemR(md, "realtime", text="")
35 split.item_enumO("OBJECT_OT_modifier_add", "type", "SOFTBODY", text="Add")
39 softbody = md.settings
41 split = layout.split()
43 bpy.types.register(PHYSICS_PT_softbody)