[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24558] trunk/blender/release/scripts/ui: used py error checking tools to fix some bugs & make pep8 corrections
Campbell Barton
ideasman42 at gmail.com
Sat Nov 14 14:35:44 CET 2009
Revision: 24558
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24558
Author: campbellbarton
Date: 2009-11-14 14:35:44 +0100 (Sat, 14 Nov 2009)
Log Message:
-----------
used py error checking tools to fix some bugs & make pep8 corrections
Modified Paths:
--------------
trunk/blender/release/scripts/ui/properties_data_armature.py
trunk/blender/release/scripts/ui/properties_data_bone.py
trunk/blender/release/scripts/ui/properties_data_camera.py
trunk/blender/release/scripts/ui/properties_data_curve.py
trunk/blender/release/scripts/ui/properties_data_empty.py
trunk/blender/release/scripts/ui/properties_data_lamp.py
trunk/blender/release/scripts/ui/properties_data_mesh.py
trunk/blender/release/scripts/ui/properties_data_text.py
trunk/blender/release/scripts/ui/properties_material.py
trunk/blender/release/scripts/ui/properties_object.py
trunk/blender/release/scripts/ui/properties_particle.py
trunk/blender/release/scripts/ui/properties_physics_common.py
trunk/blender/release/scripts/ui/properties_physics_fluid.py
trunk/blender/release/scripts/ui/properties_physics_smoke.py
trunk/blender/release/scripts/ui/properties_physics_softbody.py
trunk/blender/release/scripts/ui/properties_render.py
trunk/blender/release/scripts/ui/properties_scene.py
trunk/blender/release/scripts/ui/properties_texture.py
trunk/blender/release/scripts/ui/properties_world.py
trunk/blender/release/scripts/ui/space_console.py
trunk/blender/release/scripts/ui/space_image.py
trunk/blender/release/scripts/ui/space_info.py
trunk/blender/release/scripts/ui/space_node.py
trunk/blender/release/scripts/ui/space_sequencer.py
trunk/blender/release/scripts/ui/space_time.py
trunk/blender/release/scripts/ui/space_userpref.py
trunk/blender/release/scripts/ui/space_view3d.py
trunk/blender/release/scripts/ui/space_view3d_toolbar.py
Modified: trunk/blender/release/scripts/ui/properties_data_armature.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_armature.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_data_armature.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -21,6 +21,7 @@
narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -41,7 +42,7 @@
arm = context.armature
space = context.space_data
col2 = context.region.width > narrowui
-
+
if col2:
split = layout.split(percentage=0.65)
if ob:
@@ -60,9 +61,7 @@
def draw(self, context):
layout = self.layout
- ob = context.object
arm = context.armature
- space = context.space_data
col2 = context.region.width > narrowui
layout.itemR(arm, "pose_position", expand=True)
@@ -104,7 +103,7 @@
col.itemR(arm, "draw_names", text="Names")
col.itemR(arm, "draw_axes", text="Axes")
col.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
-
+
if col2:
col = split.column()
col.itemR(arm, "draw_group_colors", text="Colors")
@@ -140,7 +139,7 @@
split = layout.split()
split.active = (ob.proxy == None)
-
+
col = split.column()
col.itemR(group, "color_set")
if group.color_set:
@@ -198,7 +197,7 @@
col = split.column()
col.itemO("pose.paths_calculate", text="Calculate Paths")
-
+
if col2:
col = split.column()
col.itemO("pose.paths_clear", text="Clear Paths")
Modified: trunk/blender/release/scripts/ui/properties_data_bone.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_bone.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_data_bone.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -21,6 +21,7 @@
narrowui = 180
+
class BoneButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -55,14 +56,14 @@
ob = context.object
bone = context.bone
col2 = context.region.width > narrowui
-
+
if not bone:
bone = context.edit_bone
if col2:
row = layout.row()
row.column().itemR(bone, "head")
row.column().itemR(bone, "tail")
-
+
col = row.column()
sub = col.column(align=True)
sub.itemL(text="Roll:")
@@ -78,13 +79,13 @@
else:
pchan = ob.pose.pose_channels[context.bone.name]
-
+
if col2:
row = layout.row()
col = row.column()
col.itemR(pchan, "location")
col.active = not (bone.parent and bone.connected)
-
+
col = row.column()
if pchan.rotation_mode == 'QUATERNION':
col.itemR(pchan, "rotation_quaternion", text="Rotation")
@@ -95,9 +96,9 @@
col.itemR(pchan, "rotation_axis_angle", text="Rotation")
else:
col.itemR(pchan, "rotation_euler", text="Rotation")
-
+
row.column().itemR(pchan, "scale")
-
+
layout.itemR(pchan, "rotation_mode")
else:
col = layout.column()
@@ -201,7 +202,6 @@
ob = context.object
bone = context.bone
- arm = context.armature
col2 = context.region.width > narrowui
if not bone:
Modified: trunk/blender/release/scripts/ui/properties_data_camera.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_camera.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_data_camera.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -21,6 +21,7 @@
narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -44,7 +45,7 @@
if col2:
split = layout.split(percentage=0.65)
-
+
if ob:
split.template_ID(ob, "data")
split.itemS()
@@ -70,7 +71,7 @@
layout.itemR(cam, "type", text="")
split = layout.split()
-
+
col = split.column()
if cam.type == 'PERSP':
if cam.lens_unit == 'MILLIMETERS':
@@ -82,7 +83,7 @@
col.itemR(cam, "lens_unit", text="")
elif cam.type == 'ORTHO':
- row.itemR(cam, "ortho_scale")
+ col.itemR(cam, "ortho_scale")
layout.itemR(cam, "panorama")
@@ -105,7 +106,7 @@
col = split.column()
col.itemR(cam, "dof_object", text="")
-
+
if col2:
col = split.column()
col.itemR(cam, "dof_distance", text="Distance")
Modified: trunk/blender/release/scripts/ui/properties_data_curve.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_curve.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_data_curve.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -21,6 +21,7 @@
narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -57,7 +58,7 @@
space = context.space_data
col2 = context.region.width > narrowui
-
+
if col2:
split = layout.split(percentage=0.65)
@@ -70,6 +71,7 @@
else:
layout.template_ID(ob, "data")
+
class DATA_PT_shape_curve(DataButtonsPanel):
bl_label = "Shape"
@@ -78,7 +80,6 @@
ob = context.object
curve = context.curve
- space = context.space_data
col2 = context.region.width > narrowui
is_surf = (ob.type == 'SURFACE')
@@ -119,7 +120,7 @@
col = split.column()
col.itemR(curve, "twist_mode", text="Twist")
-
+
if col2:
col = split.column()
col.itemR(curve, "twist_smooth") # XXX - may not be kept
Modified: trunk/blender/release/scripts/ui/properties_data_empty.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_empty.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_data_empty.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -21,6 +21,7 @@
narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
Modified: trunk/blender/release/scripts/ui/properties_data_lamp.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_lamp.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_data_lamp.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -21,6 +21,7 @@
narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -229,7 +230,7 @@
split = layout.split()
col = split.column()
-
+
if lamp.shape == 'SQUARE':
col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
@@ -250,8 +251,8 @@
else:
if col2:
col = split.column()
-
+
elif lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column()
col.itemL(text="Buffer Type:")
Modified: trunk/blender/release/scripts/ui/properties_data_mesh.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_mesh.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_data_mesh.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -21,6 +21,7 @@
narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -184,12 +185,12 @@
row = split.row()
row.alignment = 'RIGHT'
-
+
if not col2:
layout.itemR(key, "relative")
row = layout.row()
-
-
+
+
sub = row.row(align=True)
subsub = sub.row(align=True)
subsub.active = enable_edit_value
Modified: trunk/blender/release/scripts/ui/properties_data_text.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_text.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_data_text.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -56,9 +56,7 @@
def draw(self, context):
layout = self.layout
- ob = context.object
curve = context.curve
- space = context.space_data
split = layout.split()
Modified: trunk/blender/release/scripts/ui/properties_material.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_material.py 2009-11-14 13:01:14 UTC (rev 24557)
+++ trunk/blender/release/scripts/ui/properties_material.py 2009-11-14 13:35:44 UTC (rev 24558)
@@ -21,6 +21,7 @@
narrowui = 180
+
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
# which settings from node-materials are used
@@ -93,7 +94,7 @@
if col2:
split = layout.split(percentage=0.65)
-
+
if ob:
split.template_ID(ob, "active_material", new="material.new")
row = split.row()
@@ -112,8 +113,8 @@
layout.itemR(mat, "type", expand=True)
else:
layout.itemR(mat, "type", text="")
-
+
class MATERIAL_PT_shading(MaterialButtonsPanel):
bl_label = "Shading"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
@@ -210,7 +211,7 @@
phys = context.material.physics # dont use node material
col2 = context.region.width > narrowui
-
+
split = layout.split()
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list