Merge with -r 22620:23107.
[blender.git] / release / ui / space_logic.py
index 71d94c86bf39529ffb0143e218d68ca025247eac..5748d15a53a391bbda0d363578a1a800d9825bba 100644 (file)
@@ -1,80 +1,29 @@
 import bpy
 
-class LOGIC_PT_physics(bpy.types.Panel):
-       __space_type__ = "LOGIC_EDITOR"
-       __region_type__ = "UI"
-       __label__ = "Physics"
+class LOGIC_PT_properties(bpy.types.Panel):
+       __space_type__ = 'LOGIC_EDITOR'
+       __region_type__ = 'UI'
+       __label__ = "Properties"
 
-       def draw(self, context):
-               layout = self.layout
+       def poll(self, context):
                ob = context.active_object
-               
-               game = ob.game
-
-               flow = layout.column_flow()
-               flow.active = True
-               flow.itemR(game, "physics_type")
-               flow.itemR(game, "actor")
-               
-               row = layout.row()
-               row.itemR(game, "ghost")
-               row.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
-               
-               flow = layout.column_flow()
-               flow.itemR(game, "mass")
-               flow.itemR(game, "radius")
-               flow.itemR(game, "no_sleeping")
-               flow.itemR(game, "damping")
-               flow.itemR(game, "rotation_damping")
-               flow.itemR(game, "minimum_velocity")
-               flow.itemR(game, "maximum_velocity")
-               
-               row = layout.row()
-               row.itemR(game, "do_fh")
-               row.itemR(game, "rotation_fh")
-               
-               flow = layout.column_flow()
-               flow.itemR(game, "form_factor")
-               flow.itemR(game, "anisotropic_friction")
-               
-               flow = layout.column_flow()
-               flow.active = game.anisotropic_friction
-               flow.itemR(game, "friction_coefficients")
-               
-               split = layout.split()
-               sub = split.column()
-               sub.itemR(game, "lock_x_axis")
-               sub.itemR(game, "lock_y_axis")
-               sub.itemR(game, "lock_z_axis")
-               sub = split.column()
-               sub.itemR(game, "lock_x_rot_axis")
-               sub.itemR(game, "lock_y_rot_axis")
-               sub.itemR(game, "lock_z_rot_axis")
+               return ob and ob.game
 
-
-class LOGIC_PT_collision_bounds(bpy.types.Panel):
-       __space_type__ = "LOGIC_EDITOR"
-       __region_type__ = "UI"
-       __label__ = "Collision Bounds"
-       
-       def draw_header(self, context):
+       def draw(self, context):
                layout = self.layout
+               
                ob = context.active_object
                game = ob.game
-
-               layout.itemR(game, "use_collision_bounds", text="")
+               
+               layout.itemO("object.game_property_new", text="Add Game Property")
        
-       def draw(self, context):
-               layout = self.layout
+               for i, prop in enumerate(game.properties):
                
-               ob = context.scene.objects[0]
-               game = ob.game
+                       row = layout.row(align=True)     
+                       row.itemR(prop, "name", text="")         
+                       row.itemR(prop, "type", text="")         
+                       row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly         
+                       row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')         
+                       row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
                
-               flow = layout.column_flow()
-               flow.active = game.use_collision_bounds
-               flow.itemR(game, "collision_bounds")
-               flow.itemR(game, "collision_compound")
-               flow.itemR(game, "collision_margin")
-
-bpy.types.register(LOGIC_PT_physics)
-bpy.types.register(LOGIC_PT_collision_bounds)
+bpy.types.register(LOGIC_PT_properties)