[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54423] trunk/blender/release/scripts: pep8 cleanup
Campbell Barton
ideasman42 at gmail.com
Sun Feb 10 09:54:10 CET 2013
Revision: 54423
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54423
Author: campbellbarton
Date: 2013-02-10 08:54:10 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
pep8 cleanup
Modified Paths:
--------------
trunk/blender/release/scripts/presets/keyconfig/maya.py
trunk/blender/release/scripts/startup/bl_operators/rigidbody.py
trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py
trunk/blender/release/scripts/startup/bl_ui/properties_particle.py
trunk/blender/release/scripts/startup/bl_ui/properties_physics_common.py
trunk/blender/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
trunk/blender/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
trunk/blender/release/scripts/startup/bl_ui/properties_scene.py
trunk/blender/release/scripts/startup/bl_ui/space_clip.py
trunk/blender/release/scripts/startup/bl_ui/space_image.py
trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
Modified: trunk/blender/release/scripts/presets/keyconfig/maya.py
===================================================================
--- trunk/blender/release/scripts/presets/keyconfig/maya.py 2013-02-10 08:28:47 UTC (rev 54422)
+++ trunk/blender/release/scripts/presets/keyconfig/maya.py 2013-02-10 08:54:10 UTC (rev 54423)
@@ -218,7 +218,7 @@
kmi = km.keymap_items.new('transform.mirror', 'M', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True)
kmi.properties.data_path = 'tool_settings.use_snap'
-kmi = km.keymap_items.new('WM_OT_context_menu_enum', 'TAB', 'PRESS', shift=True, ctrl=True);
+kmi = km.keymap_items.new('WM_OT_context_menu_enum', 'TAB', 'PRESS', shift=True, ctrl=True)
kmi.properties.data_path = 'tool_settings.snap_element'
kmi = km.keymap_items.new('view3d.enable_manipulator', 'W', 'PRESS')
Modified: trunk/blender/release/scripts/startup/bl_operators/rigidbody.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/rigidbody.py 2013-02-10 08:28:47 UTC (rev 54422)
+++ trunk/blender/release/scripts/startup/bl_operators/rigidbody.py 2013-02-10 08:54:10 UTC (rev 54423)
@@ -54,7 +54,7 @@
for o in objects:
if o.rigid_body is None:
continue
-
+
o.rigid_body.type = obj.rigid_body.type
o.rigid_body.kinematic = obj.rigid_body.kinematic
o.rigid_body.mass = obj.rigid_body.mass
@@ -144,7 +144,7 @@
# this is a little roundabout but there's no better way right now
aa = mat.to_quaternion().to_axis_angle()
obj.rotation_axis_angle = (aa[1], ) + aa[0][:]
- else: # euler
+ else: # euler
# make sure euler rotation is compatible to previous frame
obj.rotation_euler = mat.to_euler(rot_mode, obj_prev.rotation_euler)
@@ -190,7 +190,8 @@
class ConnectRigidBodies(Operator):
- '''Create rigid body constraints between selected and active rigid bodies'''
+ """Create rigid body constraints between """ \
+ """selected and active rigid bodies"""
bl_idname = "rigidbody.connect"
bl_label = "Connect Rigid Bodies"
bl_options = {'REGISTER', 'UNDO'}
@@ -232,7 +233,11 @@
loc = obj.location
else:
loc = (obj_act.location + obj.location) / 2.0
- bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, location=loc)
+ # TODO: use bpy.data.objects.new(...)
+ bpy.ops.object.add(type='EMPTY',
+ view_align=False,
+ enter_editmode=False,
+ location=loc)
bpy.ops.rigidbody.constraint_add()
con_obj = context.active_object
con_obj.empty_draw_type = 'ARROWS'
@@ -241,12 +246,12 @@
con.object1 = obj_act
con.object2 = obj
change = True
-
+
if change:
# restore selection
bpy.ops.object.select_all(action='DESELECT')
for obj in objects:
- obj.select = True;
+ obj.select = True
scene.objects.active = obj_act
return {'FINISHED'}
else:
Modified: trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py 2013-02-10 08:28:47 UTC (rev 54422)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py 2013-02-10 08:54:10 UTC (rev 54423)
@@ -82,7 +82,7 @@
else:
layout.row().prop(tex_slot, "tex_paint_map_mode", text="")
layout.separator()
-
+
# angle and texture_angle_source
col = layout.column()
if sculpt:
@@ -101,7 +101,7 @@
split = layout.split()
split.prop(tex_slot, "offset")
split.prop(tex_slot, "scale")
-
+
if sculpt:
# texture_sample_bias
col = layout.column(align=True)
Modified: trunk/blender/release/scripts/startup/bl_ui/properties_particle.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_particle.py 2013-02-10 08:28:47 UTC (rev 54422)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_particle.py 2013-02-10 08:54:10 UTC (rev 54423)
@@ -543,7 +543,7 @@
# spacing between particles when the fluid is at rest. This
# makes it easier to set stable initial conditions.
particle_volume = part.mass / fluid.rest_density
- spacing = pow(particle_volume, 1/3)
+ spacing = pow(particle_volume, 1.0 / 3.0)
sub = col.row()
sub.label(text="Spacing: %g" % spacing)
Modified: trunk/blender/release/scripts/startup/bl_ui/properties_physics_common.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_physics_common.py 2013-02-10 08:28:47 UTC (rev 54422)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_physics_common.py 2013-02-10 08:54:10 UTC (rev 54423)
@@ -44,6 +44,7 @@
else:
sub.operator("object.modifier_add", text=name, icon=typeicon).type = type
+
def physics_add_special(self, layout, data, name, addop, removeop, typeicon):
sub = layout.row(align=True)
if data:
@@ -51,6 +52,7 @@
else:
sub.operator(addop, text=name, icon=typeicon)
+
class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
@@ -86,13 +88,13 @@
physics_add_special(self, col, ob.rigid_body, "Rigid Body",
"rigidbody.object_add",
"rigidbody.object_remove",
- 'MESH_ICOSPHERE') # XXX: need dedicated icon
+ 'MESH_ICOSPHERE') # XXX: need dedicated icon
# all types of objects can have rigid body constraint
physics_add_special(self, col, ob.rigid_body_constraint, "Rigid Body Constraint",
"rigidbody.constraint_add",
"rigidbody.constraint_remove",
- 'CONSTRAINT') # RB_TODO needs better icon
+ 'CONSTRAINT') # RB_TODO needs better icon
# cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc
Modified: trunk/blender/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_physics_rigidbody.py 2013-02-10 08:28:47 UTC (rev 54422)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_physics_rigidbody.py 2013-02-10 08:54:10 UTC (rev 54423)
@@ -32,22 +32,22 @@
@classmethod
def poll(cls, context):
- ob = context.object
- rd = context.scene.render
- return (ob and ob.rigid_body and (not rd.use_game_engine))
+ obj = context.object
+ return (obj and obj.rigid_body and
+ (not context.scene.render.use_game_engine))
def draw_header(self, context):
obj = context.object
rbo = obj.rigid_body
if rbo is not None:
- self.layout.prop(rbo, "enabled", text="");
+ self.layout.prop(rbo, "enabled", text="")
def draw(self, context):
layout = self.layout
ob = context.object
rbo = ob.rigid_body
-
+
if rbo is not None:
layout.prop(rbo, "type", text="Type")
layout.prop(rbo, "kinematic", text="Animated")
@@ -61,34 +61,35 @@
@classmethod
def poll(cls, context):
- return (context.object and context.object.rigid_body and
+ obj = context.object
+ return (obj and obj.rigid_body and
(not context.scene.render.use_game_engine))
-
+
def draw(self, context):
layout = self.layout
ob = context.object
rbo = ob.rigid_body
-
+
layout.prop(rbo, "collision_shape", text="Shape")
-
+
split = layout.split()
-
+
col = split.column()
col.label(text="Surface Response:")
col.prop(rbo, "friction")
col.prop(rbo, "restitution", text="Bounciness")
-
+
col = split.column()
col.label(text="Sensitivity:")
if rbo.collision_shape in {'MESH', 'CONE'}:
col.prop(rbo, "collision_margin", text="Margin")
else:
- col.prop(rbo, "use_margin");
+ col.prop(rbo, "use_margin")
sub = col.column()
sub.active = rbo.use_margin
sub.prop(rbo, "collision_margin", text="Margin")
-
+
layout.prop(rbo, "collision_groups")
@@ -98,22 +99,23 @@
@classmethod
def poll(cls, context):
- return (context.object and context.object.rigid_body and
- context.object.rigid_body.type == 'ACTIVE' and
+ obj = context.object
+ return (obj and obj.rigid_body and
+ obj.rigid_body.type == 'ACTIVE' and
(not context.scene.render.use_game_engine))
-
+
def draw(self, context):
layout = self.layout
ob = context.object
rbo = ob.rigid_body
-
+
#col = layout.column(align=1)
#col.label(text="Activation:")
# XXX: settings such as activate on collison/etc.
-
- split = layout.split();
-
+
+ split = layout.split()
+
col = split.column()
col.label(text="Deactivation:")
col.prop(rbo, "use_deactivation")
@@ -123,7 +125,7 @@
sub.prop(rbo, "deactivate_linear_velocity", text="Linear Vel")
sub.prop(rbo, "deactivate_angular_velocity", text="Angular Vel")
# TODO: other params such as time?
-
+
col = split.column()
col.label(text="Damping:")
col.prop(rbo, "linear_damping", text="Translation")
Modified: trunk/blender/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list