Revision: 20593
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20593
Author:   blendix
Date:     2009-06-03 02:17:35 +0200 (Wed, 03 Jun 2009)

Log Message:
-----------
UI: 
* Add Lamp Fallof Curve and Texture Color Ramp panels.
* Use button space context data.
* A few other minor python layout script updates.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_data_armature.py
    branches/blender2.5/blender/release/ui/buttons_data_bone.py
    branches/blender2.5/blender/release/ui/buttons_data_camera.py
    branches/blender2.5/blender/release/ui/buttons_data_curve.py
    branches/blender2.5/blender/release/ui/buttons_data_empty.py
    branches/blender2.5/blender/release/ui/buttons_data_lamp.py
    branches/blender2.5/blender/release/ui/buttons_data_lattice.py
    branches/blender2.5/blender/release/ui/buttons_data_mesh.py
    branches/blender2.5/blender/release/ui/buttons_data_modifier.py
    branches/blender2.5/blender/release/ui/buttons_data_text.py
    branches/blender2.5/blender/release/ui/buttons_material.py
    branches/blender2.5/blender/release/ui/buttons_object_constraint.py
    branches/blender2.5/blender/release/ui/buttons_objects.py
    branches/blender2.5/blender/release/ui/buttons_particle.py
    branches/blender2.5/blender/release/ui/buttons_physic_cloth.py
    branches/blender2.5/blender/release/ui/buttons_scene.py
    branches/blender2.5/blender/release/ui/buttons_texture.py
    branches/blender2.5/blender/release/ui/buttons_world.py

Modified: branches/blender2.5/blender/release/ui/buttons_data_armature.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_armature.py     
2009-06-03 00:14:12 UTC (rev 20592)
+++ branches/blender2.5/blender/release/ui/buttons_data_armature.py     
2009-06-03 00:17:35 UTC (rev 20593)
@@ -7,15 +7,14 @@
        __context__ = "data"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob and ob.type == 'ARMATURE')
+               return (context.armature != None)
 
 class DATA_PT_skeleton(DataButtonsPanel):
        __idname__ = "DATA_PT_skeleton"
        __label__ = "Skeleton"
 
        def draw(self, context):
-               arm = context.active_object.data
+               arm = context.armature
                layout = self.layout
                
                layout.itemR(arm, "rest_position")
@@ -42,7 +41,7 @@
        __label__ = "Display"
        
        def draw(self, context):
-               arm = context.active_object.data
+               arm = context.armature
                layout = self.layout
 
                split = layout.split()
@@ -62,7 +61,7 @@
        __label__ = "Paths"
 
        def draw(self, context):
-               arm = context.active_object.data
+               arm = context.armature
                layout = self.layout
 
                split = layout.split()
@@ -90,7 +89,7 @@
        __label__ = "Ghost"
 
        def draw(self, context):
-               arm = context.active_object.data
+               arm = context.armature
                layout = self.layout
 
                split = layout.split()
@@ -111,4 +110,4 @@
 bpy.types.register(DATA_PT_skeleton)
 bpy.types.register(DATA_PT_display)
 bpy.types.register(DATA_PT_paths)
-bpy.types.register(DATA_PT_ghost)
\ No newline at end of file
+bpy.types.register(DATA_PT_ghost)

Modified: branches/blender2.5/blender/release/ui/buttons_data_bone.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_bone.py 2009-06-03 
00:14:12 UTC (rev 20592)
+++ branches/blender2.5/blender/release/ui/buttons_data_bone.py 2009-06-03 
00:17:35 UTC (rev 20593)
@@ -7,15 +7,14 @@
        __context__ = "bone"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob and ob.type == 'ARMATURE')
+               return (context.bone != None)
 
 class BONE_PT_bone(BoneButtonsPanel):
        __idname__ = "BONE_PT_bone"
        __label__ = "Bone"
 
        def draw(self, context):
-               bone = context.active_object.data.bones[0]
+               bone = context.bone
                layout = self.layout
 
                split = layout.split()

Modified: branches/blender2.5/blender/release/ui/buttons_data_camera.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_camera.py       
2009-06-03 00:14:12 UTC (rev 20592)
+++ branches/blender2.5/blender/release/ui/buttons_data_camera.py       
2009-06-03 00:17:35 UTC (rev 20593)
@@ -7,15 +7,14 @@
        __context__ = "data"
 
        def poll(self, context):
-               ob = context.active_object
-               return (ob and ob.type == 'CAMERA')
+               return (context.camera != None)
                
 class DATA_PT_cameralens(DataButtonsPanel):
        __idname__ = "DATA_PT_camera"
        __label__ = "Lens"
 
        def draw(self, context):
-               cam = context.active_object.data
+               cam = context.camera
                layout = self.layout
 
                layout.itemR(cam, "type", expand=True)
@@ -52,7 +51,7 @@
        __label__ = "Display"
        
        def draw(self, context):
-               cam = context.active_object.data
+               cam = context.camera
                layout = self.layout
 
                split = layout.split()
@@ -71,4 +70,4 @@
                col.itemR(cam, "draw_size", text="Size")
                
 bpy.types.register(DATA_PT_cameralens)
-bpy.types.register(DATA_PT_cameradisplay)
\ No newline at end of file
+bpy.types.register(DATA_PT_cameradisplay)

Modified: branches/blender2.5/blender/release/ui/buttons_data_curve.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_curve.py        
2009-06-03 00:14:12 UTC (rev 20592)
+++ branches/blender2.5/blender/release/ui/buttons_data_curve.py        
2009-06-03 00:17:35 UTC (rev 20593)
@@ -7,15 +7,15 @@
        __context__ = "data"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob and ob.type == 'CURVE')
+               ob = context.object
+               return (ob and ob.type == 'CURVE' and context.curve)
 
 class DATA_PT_shape_curve(DataButtonsPanel):
                __idname__ = "DATA_PT_shape_curve"
                __label__ = "Shape"
 
                def draw(self, context):
-                       curve = context.active_object.data
+                       curve = context.curve
                        layout = self.layout
 
                        layout.itemR(curve, "curve_2d")                 
@@ -50,7 +50,7 @@
                __label__ = "Geometry"
 
                def draw(self, context):
-                       curve = context.active_object.data
+                       curve = context.curve
                        layout = self.layout
 
                        split = layout.split()
@@ -72,13 +72,13 @@
                __label__ = "Path Animation"
                
                def draw_header(self, context):
-                       curve = context.active_object.data
+                       curve = context.curve
 
                        layout = self.layout
                        layout.itemR(curve, "path", text="")
 
                def draw(self, context):
-                       curve = context.active_object.data
+                       curve = context.curve
                        layout = self.layout
                        layout.active = curve.path      
                        
@@ -97,7 +97,7 @@
                __label__ = "Current Curve"
 
                def draw(self, context):
-                       currentcurve = context.active_object.data.curves[0]
+                       currentcurve = context.curve.curves[0] # XXX
                        layout = self.layout
 
                        split = layout.split()
@@ -128,4 +128,4 @@
 bpy.types.register(DATA_PT_shape_curve)
 bpy.types.register(DATA_PT_geometry)
 bpy.types.register(DATA_PT_pathanim)
-bpy.types.register(DATA_PT_current_curve)
\ No newline at end of file
+bpy.types.register(DATA_PT_current_curve)

Modified: branches/blender2.5/blender/release/ui/buttons_data_empty.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_empty.py        
2009-06-03 00:14:12 UTC (rev 20592)
+++ branches/blender2.5/blender/release/ui/buttons_data_empty.py        
2009-06-03 00:17:35 UTC (rev 20593)
@@ -7,7 +7,7 @@
        __context__ = "data"
        
        def poll(self, context):
-               ob = context.active_object
+               ob = context.object
                return (ob and ob.type == 'EMPTY')
        
 class DATA_PT_empty(DataButtonsPanel):
@@ -15,10 +15,10 @@
        __label__ = "Empty"
 
        def draw(self, context):
-               ob = context.active_object
+               ob = context.object
                layout = self.layout
 
                layout.itemR(ob, "empty_draw_type")
                layout.itemR(ob, "empty_draw_size")
                
-bpy.types.register(DATA_PT_empty)
\ No newline at end of file
+bpy.types.register(DATA_PT_empty)

Modified: branches/blender2.5/blender/release/ui/buttons_data_lamp.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lamp.py 2009-06-03 
00:14:12 UTC (rev 20592)
+++ branches/blender2.5/blender/release/ui/buttons_data_lamp.py 2009-06-03 
00:17:35 UTC (rev 20593)
@@ -7,15 +7,14 @@
        __context__ = "data"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob and ob.type == 'LAMP')
+               return (context.lamp != None)
        
 class DATA_PT_lamp(DataButtonsPanel):
        __idname__ = "DATA_PT_lamp"
        __label__ = "Lamp"
 
        def draw(self, context):
-               lamp = context.active_object.data
+               lamp = context.lamp
                layout = self.layout
 
                layout.itemR(lamp, "type", expand=True)
@@ -56,11 +55,11 @@
        __label__ = "Sun/Sky"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob.type == 'LAMP' and ob.data.type == 'SUN')
+               lamp = context.lamp
+               return (lamp and lamp.type == 'SUN')
 
        def draw(self, context):
-               lamp = context.active_object.data.sky
+               lamp = context.lamp.sky
                layout = self.layout
 
                row = layout.row()
@@ -99,11 +98,11 @@
        __label__ = "Shadow"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob.type == 'LAMP' and ob.data.type in ('POINT','SUN', 
'SPOT', 'AREA'))
+               lamp = context.lamp
+               return (lamp and lamp.type in ('POINT','SUN', 'SPOT', 'AREA'))
 
        def draw(self, context):
-               lamp = context.active_object.data
+               lamp = context.lamp
                layout = self.layout
 
                layout.itemR(lamp, "shadow_method", expand=True)
@@ -178,11 +177,11 @@
        __label__ = "Spot"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob.type == 'LAMP' and ob.data.type == 'SPOT')
+               lamp = context.lamp
+               return (lamp and lamp.type == 'SPOT')
 
        def draw(self, context):
-               lamp = context.active_object.data
+               lamp = context.lamp
                layout = self.layout
 
                split = layout.split()
@@ -200,7 +199,28 @@
                if lamp.shadow_method == 'BUFFER_SHADOW':
                        colsub.itemR(lamp, "halo_step", text="Step")
 
+class DATA_PT_falloff_curve(DataButtonsPanel):
+       __idname__ = "DATA_PT_falloff_curve"
+       __label__ = "Falloff Curve"
+       
+       def poll(self, context):
+               lamp = context.lamp
+
+               if lamp and lamp.type in ('POINT', 'SPOT'):
+                       if lamp.falloff_type == 'CUSTOM_CURVE':
+                               return True
+
+               return False
+
+       def draw(self, context):
+               lamp = context.lamp
+               layout = self.layout
+
+               layout.template_curve_mapping(lamp.falloff_curve)
+
 bpy.types.register(DATA_PT_lamp)
 bpy.types.register(DATA_PT_shadow)
 bpy.types.register(DATA_PT_sunsky)
-bpy.types.register(DATA_PT_spot)
\ No newline at end of file
+bpy.types.register(DATA_PT_spot)
+bpy.types.register(DATA_PT_falloff_curve)
+

Modified: branches/blender2.5/blender/release/ui/buttons_data_lattice.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lattice.py      
2009-06-03 00:14:12 UTC (rev 20592)
+++ branches/blender2.5/blender/release/ui/buttons_data_lattice.py      
2009-06-03 00:17:35 UTC (rev 20593)
@@ -7,15 +7,14 @@
        __context__ = "data"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob and ob.type == 'LATTICE')
+               return (context.lattice != None)
        
 class DATA_PT_lattice(DataButtonsPanel):
        __idname__ = "DATA_PT_lattice"
        __label__ = "Lattice"
 
        def draw(self, context):
-               lat = context.active_object.data
+               lat = context.lattice
                layout = self.layout
 
                row = layout.row()
@@ -34,4 +33,4 @@
                row.itemR(lat, "outside")
                row.itemR(lat, "shape_keys")
 
-bpy.types.register(DATA_PT_lattice)
\ No newline at end of file
+bpy.types.register(DATA_PT_lattice)

Modified: branches/blender2.5/blender/release/ui/buttons_data_mesh.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-06-03 
00:14:12 UTC (rev 20592)
+++ branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-06-03 
00:17:35 UTC (rev 20593)
@@ -7,15 +7,14 @@
        __context__ = "data"
        
        def poll(self, context):
-               ob = context.active_object
-               return (ob and ob.type == 'MESH')
+               return (context.mesh != None)
 
 class DATA_PT_surface(DataButtonsPanel):
                __idname__ = "DATA_PT_surface"
                __label__ = "Mesh"
 
                def draw(self, context):

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to