Merge from 2.5 r20991 through r21037
[blender.git] / release / ui / buttons_objects.py
index 8f02a015eac439a65f07dbea52de5a19daf87a35..3138f447ad2f078f7e47c94a81d428e5d4c2b36c 100644 (file)
@@ -6,16 +6,13 @@ class ObjectButtonsPanel(bpy.types.Panel):
        __region_type__ = "WINDOW"
        __context__ = "object"
 
-       def poll(self, context):
-               return (context.active_object != None)
-
 class OBJECT_PT_transform(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_transform"
        __label__ = "Transform"
 
        def draw(self, context):
-               ob = context.active_object
                layout = self.layout
+               ob = context.object
 
                row = layout.row()
                row.column().itemR(ob, "location")
@@ -27,8 +24,8 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
        __label__ = "Groups"
 
        def draw(self, context):
-               ob = context.active_object
                layout = self.layout
+               ob = context.object
 
                row = layout.row()
                row.itemR(ob, "pass_index")
@@ -38,24 +35,24 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
                # layout.itemO("OBJECT_OT_add_group");
 
                for group in bpy.data.groups:
-                       if ob in group.objects:
-                               box = layout.box()
+                       if ob.name in group.objects:
+                               col = layout.column(align=True)
 
-                               row = box.row()
-                               row.itemR(group, "name")
+                               row = col.box().row()
+                               row.itemR(group, "name", text="")
                                #row.itemO("OBJECT_OT_remove_group")
 
-                               row = box.row()
-                               row.column().itemR(group, "layer")
-                               row.column().itemR(group, "dupli_offset")
+                               split = col.box().split()
+                               split.column().itemR(group, "layer")
+                               split.column().itemR(group, "dupli_offset")
 
 class OBJECT_PT_display(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_display"
        __label__ = "Display"
 
        def draw(self, context):
-               ob = context.active_object
                layout = self.layout
+               ob = context.object
                        
                row = layout.row()
                row.itemR(ob, "max_draw_type", text="Type")
@@ -74,8 +71,8 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
        __label__ = "Duplication"
 
        def draw(self, context):
-               ob = context.active_object
                layout = self.layout
+               ob = context.object
 
                layout.itemR(ob, "dupli_type", expand=True)
 
@@ -108,8 +105,8 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
        __label__ = "Animation"
 
        def draw(self, context):
-               ob = context.active_object
                layout = self.layout
+               ob = context.object
                
                split = layout.split()