[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20865] branches/blender2.5/blender: 2. 5 Buttons:
Thomas Dinges
dingto at gmx.de
Sat Jun 13 23:22:22 CEST 2009
Revision: 20865
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20865
Author: dingto
Date: 2009-06-13 23:22:21 +0200 (Sat, 13 Jun 2009)
Log Message:
-----------
2.5 Buttons:
* Added more material buttons by William. Thanks.
I made some minor adjustments and added Specular Shader Model RNA.
* Code cleanup and some consistency tweaks of button files.
Notes: Preview render now only shows up when there is an active world, material, texture or lamp.
* Made sure initial panels with ID Datablocks are shown, even when no block is active.
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_objects.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
branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c
Modified: branches/blender2.5/blender/release/ui/buttons_data_armature.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_armature.py 2009-06-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_armature.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -12,12 +12,16 @@
class DATA_PT_skeleton(DataButtonsPanel):
__idname__ = "DATA_PT_skeleton"
__label__ = "Skeleton"
+
+ def poll(self, context):
+ return (context.object.type == 'ARMATURE' or context.armature)
def draw(self, context):
+ layout = self.layout
+
ob = context.object
arm = context.armature
space = context.space_data
- layout = self.layout
split = layout.split(percentage=0.65)
@@ -54,8 +58,8 @@
__label__ = "Display"
def draw(self, context):
+ layout = self.layout
arm = context.armature
- layout = self.layout
split = layout.split()
@@ -74,8 +78,8 @@
__label__ = "Paths"
def draw(self, context):
+ layout = self.layout
arm = context.armature
- layout = self.layout
split = layout.split()
@@ -102,8 +106,8 @@
__label__ = "Ghost"
def draw(self, context):
+ layout = self.layout
arm = context.armature
- layout = self.layout
split = layout.split()
@@ -123,4 +127,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)
+bpy.types.register(DATA_PT_ghost)
\ No newline at end of file
Modified: branches/blender2.5/blender/release/ui/buttons_data_bone.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_bone.py 2009-06-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_bone.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -14,8 +14,8 @@
__label__ = "Bone"
def draw(self, context):
- bone = context.bone
layout = self.layout
+ bone = context.bone
split = layout.split()
@@ -50,5 +50,4 @@
sub.itemR(bone, "cyclic_offset")
-bpy.types.register(BONE_PT_bone)
-
+bpy.types.register(BONE_PT_bone)
\ No newline at end of file
Modified: branches/blender2.5/blender/release/ui/buttons_data_camera.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_camera.py 2009-06-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_camera.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -12,12 +12,16 @@
class DATA_PT_camera(DataButtonsPanel):
__idname__ = "DATA_PT_camera"
__label__ = "Lens"
+
+ def poll(self, context):
+ return (context.object.type == 'CAMERA')
def draw(self, context):
+ layout = self.layout
+
ob = context.object
cam = context.camera
space = context.space_data
- layout = self.layout
split = layout.split(percentage=0.65)
@@ -62,7 +66,7 @@
class DATA_PT_camera_display(DataButtonsPanel):
__idname__ = "DATA_PT_camera_display"
__label__ = "Display"
-
+
def draw(self, context):
cam = context.camera
layout = self.layout
@@ -83,4 +87,4 @@
col.itemR(cam, "draw_size", text="Size")
bpy.types.register(DATA_PT_camera)
-bpy.types.register(DATA_PT_camera_display)
+bpy.types.register(DATA_PT_camera_display)
\ No newline at end of file
Modified: branches/blender2.5/blender/release/ui/buttons_data_curve.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_curve.py 2009-06-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_curve.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -7,18 +7,21 @@
__context__ = "data"
def poll(self, context):
- ob = context.object
- return (ob and ob.type == 'CURVE' and context.curve)
+ return (context.object.type == 'CURVE' and context.curve)
class DATA_PT_shape_curve(DataButtonsPanel):
__idname__ = "DATA_PT_shape_curve"
__label__ = "Shape"
+
+ def poll(self, context):
+ return (context.object.type == 'CURVE')
def draw(self, context):
+ layout = self.layout
+
ob = context.object
curve = context.curve
space = context.space_data
- layout = self.layout
split = layout.split(percentage=0.65)
@@ -63,8 +66,8 @@
__label__ = "Geometry"
def draw(self, context):
+ layout = self.layout
curve = context.curve
- layout = self.layout
split = layout.split()
@@ -85,9 +88,9 @@
__label__ = "Path Animation"
def draw_header(self, context):
+ layout = self.layout
curve = context.curve
- layout = self.layout
layout.itemR(curve, "path", text="")
def draw(self, context):
@@ -110,8 +113,8 @@
__label__ = "Current Curve"
def draw(self, context):
+ layout = self.layout
currentcurve = context.curve.curves[0] # XXX
- layout = self.layout
split = layout.split()
@@ -141,4 +144,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)
+bpy.types.register(DATA_PT_current_curve)
\ No newline at end of file
Modified: branches/blender2.5/blender/release/ui/buttons_data_empty.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_empty.py 2009-06-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_empty.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -7,18 +7,17 @@
__context__ = "data"
def poll(self, context):
- ob = context.object
- return (ob and ob.type == 'EMPTY')
+ return (context.object.type == 'EMPTY')
class DATA_PT_empty(DataButtonsPanel):
__idname__ = "DATA_PT_empty"
__label__ = "Empty"
def draw(self, context):
- ob = context.object
layout = self.layout
+ ob = context.object
layout.itemR(ob, "empty_draw_type")
layout.itemR(ob, "empty_draw_size")
-bpy.types.register(DATA_PT_empty)
+bpy.types.register(DATA_PT_empty)
\ No newline at end of file
Modified: branches/blender2.5/blender/release/ui/buttons_data_lamp.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lamp.py 2009-06-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_lamp.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -22,12 +22,16 @@
class DATA_PT_lamp(DataButtonsPanel):
__idname__ = "DATA_PT_lamp"
__label__ = "Lamp"
+
+ def poll(self, context):
+ return (context.object.type == 'LAMP')
def draw(self, context):
+ layout = self.layout
+
ob = context.object
lamp = context.lamp
space = context.space_data
- layout = self.layout
split = layout.split(percentage=0.65)
@@ -82,8 +86,8 @@
return (lamp and lamp.type == 'SUN')
def draw(self, context):
+ layout = self.layout
lamp = context.lamp.sky
- layout = self.layout
row = layout.row()
row.itemR(lamp, "sky")
@@ -96,7 +100,6 @@
split = layout.split()
col = split.column()
-
sub = col.column()
sub.active = lamp.sky
sub.itemR(lamp, "sky_blend_type", text="Blend Type")
@@ -125,8 +128,8 @@
return (lamp and lamp.type in ('POINT','SUN', 'SPOT', 'AREA'))
def draw(self, context):
+ layout = self.layout
lamp = context.lamp
- layout = self.layout
layout.itemR(lamp, "shadow_method", expand=True)
@@ -204,8 +207,8 @@
return (lamp and lamp.type == 'SPOT')
def draw(self, context):
+ layout = self.layout
lamp = context.lamp
- layout = self.layout
split = layout.split()
@@ -236,8 +239,8 @@
return False
def draw(self, context):
+ layout = self.layout
lamp = context.lamp
- layout = self.layout
layout.template_curve_mapping(lamp.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-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_lattice.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -12,12 +12,16 @@
class DATA_PT_lattice(DataButtonsPanel):
__idname__ = "DATA_PT_lattice"
__label__ = "Lattice"
+
+ def poll(self, context):
+ return (context.object.type == 'LATTICE')
def draw(self, context):
+ layout = self.layout
+
ob = context.object
lat = context.lattice
space = context.space_data
- layout = self.layout
split = layout.split(percentage=0.65)
@@ -47,4 +51,4 @@
row.itemR(lat, "outside")
row.itemR(lat, "shape_keys")
-bpy.types.register(DATA_PT_lattice)
+bpy.types.register(DATA_PT_lattice)
\ No newline at end of file
Modified: branches/blender2.5/blender/release/ui/buttons_data_mesh.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-06-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -12,12 +12,16 @@
class DATA_PT_mesh(DataButtonsPanel):
__idname__ = "DATA_PT_mesh"
__label__ = "Mesh"
+
+ def poll(self, context):
+ return (context.object.type == 'MESH')
def draw(self, context):
+ layout = self.layout
+
ob = context.object
mesh = context.mesh
space = context.space_data
- layout = self.layout
split = layout.split(percentage=0.65)
@@ -44,4 +48,4 @@
layout.itemR(mesh, "texco_mesh")
-bpy.types.register(DATA_PT_mesh)
+bpy.types.register(DATA_PT_mesh)
\ No newline at end of file
Modified: branches/blender2.5/blender/release/ui/buttons_data_modifier.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_modifier.py 2009-06-13 20:58:43 UTC (rev 20864)
+++ branches/blender2.5/blender/release/ui/buttons_data_modifier.py 2009-06-13 21:22:21 UTC (rev 20865)
@@ -5,11 +5,7 @@
__space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW"
__context__ = "modifier"
-
- def poll(self, context):
- ob = context.object
- return (ob and ob.type in ('MESH', 'CURVE', 'SURFACE', 'TEXT', 'LATTICE'))
-
+
class DATA_PT_modifiers(DataButtonsPanel):
__idname__ = "DATA_PT_modifiers"
__label__ = "Modifiers"
@@ -415,4 +411,4 @@
col.itemR(md, "width", slider=True)
col.itemR(md, "narrowness", slider=True)
-bpy.types.register(DATA_PT_modifiers)
+bpy.types.register(DATA_PT_modifiers)
\ No newline at end of file
Modified: branches/blender2.5/blender/release/ui/buttons_data_text.py
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list