Skip to content

Commit

Permalink
UI: Use Blender Render physics panels
Browse files Browse the repository at this point in the history
TODO: Make custom panels to remove unused options.
  • Loading branch information
Moguri committed Apr 21, 2017
1 parent 7ef342f commit b28a54f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,24 @@ def draw(self, context):
else:
layout.label("Not supported")


class PandaPhysics_PT_add(PandaButtonsPanel, bpy.types.Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}

@classmethod
def poll(self, context):
return PandaButtonsPanel.poll(context) and context.object

def draw(self, context):
layout = self.layout
obj = context.object

if obj.rigid_body:
layout.operator('rigidbody.object_remove', text="Remove Rigid Body Physics")
else:
layout.operator('rigidbody.object_add', text="Add Rigid Body Physics")

def get_panels():
panels = [
"DATA_PT_camera_display",
Expand All @@ -228,6 +246,8 @@ def get_panels():
"TEXTURE_PT_image_mapping",
"TEXTURE_PT_mapping",
"TEXTURE_PT_influence",
"PHYSICS_PT_rigid_body",
"PHYSICS_PT_rigid_body_collisions",
]

return [getattr(bpy.types, p) for p in panels if hasattr(bpy.types, p)]
Expand Down

0 comments on commit b28a54f

Please sign in to comment.