UI:
[blender-staging.git] / release / ui / buttons_objects.py
index f971d167f7f83aca6825049189b4495a7c719a74..8e76bf5083732d6631b51601deddf6fe7cbac7e0 100644 (file)
@@ -6,6 +6,9 @@ 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"
@@ -14,9 +17,6 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               if not ob:
-                       return
-
                layout.row()
                layout.itemR(ob, "location")
                layout.itemR(ob, "rotation")
@@ -30,9 +30,6 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               if not ob:
-                       return
-
                layout.row()
                layout.itemR(ob, "pass_index")
                layout.itemR(ob, "parent")
@@ -59,13 +56,7 @@ class OBJECT_PT_display(ObjectButtonsPanel):
        def draw(self, context):
                ob = context.active_object
                layout = self.layout
-
-               if not ob:
-                       return
                        
-               layout.row()
-               layout.itemR(ob, "type", text="Object Type")
-
                layout.row()
                layout.itemR(ob, "max_draw_type", text="Type")
                layout.itemR(ob, "draw_bounds_type", text="Bounds")
@@ -86,18 +77,15 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               if not ob:
-                       return
-
                layout.column()
                layout.itemR(ob, "dupli_type", text="", expand=True)
 
                if ob.dupli_type == "FRAMES":
                        layout.column_flow()
-                       layout.itemR(ob, "dupli_frames_start", text="Start:")
-                       layout.itemR(ob, "dupli_frames_end", text="End:")
-                       layout.itemR(ob, "dupli_frames_on", text="On:")
-                       layout.itemR(ob, "dupli_frames_off", text="Off:")
+                       layout.itemR(ob, "dupli_frames_start", text="Start")
+                       layout.itemR(ob, "dupli_frames_end", text="End")
+                       layout.itemR(ob, "dupli_frames_on", text="On")
+                       layout.itemR(ob, "dupli_frames_off", text="Off")
 
 class OBJECT_PT_animation(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_animation"
@@ -107,9 +95,6 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
                ob = context.active_object
                layout = self.layout
 
-               if not ob:
-                       return
-
                layout.split(number=2)
                
                sub = layout.sub(0)
@@ -119,7 +104,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
                sub.itemR(ob, "time_offset_particle", text="Particle")
                sub.itemR(ob, "time_offset_parent", text="Parent")
                sub.itemR(ob, "slow_parent")
-               sub.itemR(ob, "time_offset", text="Offset:")
+               sub.itemR(ob, "time_offset", text="Offset")
                
                sub = layout.sub(1)
                sub.column()