4 class PhysicButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
7 __context__ = "physics"
9 def poll(self, context):
10 return (context.object != None)
12 class PHYSICS_PT_field(PhysicButtonsPanel):
13 __idname__ = "PHYSICS_PT_field"
16 def draw(self, context):
21 layout.itemR(field, "type")
23 if field.type != "NONE":
24 layout.itemR(field, "strength")
26 if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "LENNARDj"):
27 if ob.type in ("MESH", "SURFACE", "FONT", "CURVE"):
28 layout.itemR(field, "surface")
30 class PHYSICS_PT_collision(PhysicButtonsPanel):
31 __idname__ = "PHYSICS_PT_collision"
32 __label__ = "Collision"
34 def poll(self, context):
36 return (ob and ob.type == 'MESH')
38 def draw_header(self, context):
39 settings = context.object.collision
40 self.layout.itemR(settings, "enabled", text="")
42 def draw(self, context):
44 md = context.collision
45 settings = context.object.collision
50 bpy.types.register(PHYSICS_PT_field)
51 bpy.types.register(PHYSICS_PT_collision)