move rigidbody toggle into the header for scene and objects.
This commit is contained in:
@@ -35,7 +35,13 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
|
|||||||
ob = context.object
|
ob = context.object
|
||||||
rd = context.scene.render
|
rd = context.scene.render
|
||||||
return (ob and ob.rigid_body and (not rd.use_game_engine))
|
return (ob and ob.rigid_body and (not rd.use_game_engine))
|
||||||
|
|
||||||
|
def draw_header(self, context):
|
||||||
|
obj = context.object
|
||||||
|
rbo = obj.rigid_body
|
||||||
|
if rbo is not None:
|
||||||
|
self.layout.prop(rbo, "enabled", text="");
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
@@ -46,7 +52,6 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
|
|||||||
layout.prop(rbo, "type", text="Type")
|
layout.prop(rbo, "type", text="Type")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(rbo, "enabled");
|
|
||||||
row.prop(rbo, "kinematic", text="Animated")
|
row.prop(rbo, "kinematic", text="Animated")
|
||||||
|
|
||||||
if rbo.type == 'ACTIVE':
|
if rbo.type == 'ACTIVE':
|
||||||
|
@@ -252,10 +252,16 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
rd = context.scene.render
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
|
rd = scene.render
|
||||||
return scene and (rd.engine in cls.COMPAT_ENGINES)
|
return scene and (rd.engine in cls.COMPAT_ENGINES)
|
||||||
|
|
||||||
|
def draw_header(self, context):
|
||||||
|
scene = context.scene
|
||||||
|
rbw = scene.rigidbody_world
|
||||||
|
if rbw is not None:
|
||||||
|
self.layout.prop(rbw, "enabled", text="")
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
@@ -268,8 +274,6 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
|
|||||||
else:
|
else:
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
split.operator("rigidbody.world_remove")
|
split.operator("rigidbody.world_remove")
|
||||||
layout.separator()
|
|
||||||
layout.prop(context.scene.rigidbody_world, "enabled")
|
|
||||||
layout.active = rbw.enabled
|
layout.active = rbw.enabled
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
Reference in New Issue
Block a user