[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3791] trunk/py/scripts/addons: pep8 cleanup
Campbell Barton
ideasman42 at gmail.com
Wed Sep 26 23:23:03 CEST 2012
Revision: 3791
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3791
Author: campbellbarton
Date: 2012-09-26 21:23:02 +0000 (Wed, 26 Sep 2012)
Log Message:
-----------
pep8 cleanup
Modified Paths:
--------------
trunk/py/scripts/addons/object_fracture_cell/fracture_cell_calc.py
trunk/py/scripts/addons/object_fracture_cell/fracture_cell_setup.py
trunk/py/scripts/addons/space_view3d_copy_attributes.py
trunk/py/scripts/addons/ui_translate/utils.py
Modified: trunk/py/scripts/addons/object_fracture_cell/fracture_cell_calc.py
===================================================================
--- trunk/py/scripts/addons/object_fracture_cell/fracture_cell_calc.py 2012-09-26 20:57:00 UTC (rev 3790)
+++ trunk/py/scripts/addons/object_fracture_cell/fracture_cell_calc.py 2012-09-26 21:23:02 UTC (rev 3791)
@@ -93,7 +93,7 @@
plane.resize_4d()
plane[3] = (-nlength / 2.0) + margin_cell
planes.append(plane)
-
+
vertices[:], plane_indices[:] = mathutils.geometry.points_in_planes(planes)
if len(vertices) == 0:
break
Modified: trunk/py/scripts/addons/object_fracture_cell/fracture_cell_setup.py
===================================================================
--- trunk/py/scripts/addons/object_fracture_cell/fracture_cell_setup.py 2012-09-26 20:57:00 UTC (rev 3790)
+++ trunk/py/scripts/addons/object_fracture_cell/fracture_cell_setup.py 2012-09-26 21:23:02 UTC (rev 3791)
@@ -29,7 +29,6 @@
_redraw_yasiamevil.opr = bpy.ops.wm.redraw_timer
_redraw_yasiamevil.arg = dict(type='DRAW_WIN_SWAP', iterations=1)
-
def _points_from_object(obj, source):
@@ -83,7 +82,6 @@
for psys in obj.particle_systems
for p in psys.particles])
-
# geom own
if 'VERT_OWN' in source:
points_from_verts(obj)
@@ -137,7 +135,7 @@
use_debug_redraw=False,
cell_scale=(1.0, 1.0, 1.0),
):
-
+
from . import fracture_cell_calc
# -------------------------------------------------------------------------
@@ -159,7 +157,6 @@
random.shuffle(points)
points[source_limit:] = []
-
# saddly we cant be sure there are no doubles
from mathutils import Vector
to_tuple = Vector.to_tuple
@@ -179,10 +176,9 @@
scalar = source_noise * ((bb_world[0] - bb_world[6]).length / 2.0)
from mathutils.noise import random_unit_vector
-
+
points[:] = [p + (random_unit_vector() * (scalar * random())) for p in points]
-
if use_debug_points:
bm = bmesh.new()
for p in points:
@@ -205,9 +201,9 @@
# some hacks here :S
cell_name = obj.name + "_cell"
-
+
objects = []
-
+
for center_point, cell_points in cells:
# ---------------------------------------------------------------------
@@ -215,21 +211,22 @@
# create the convex hulls
bm = bmesh.new()
-
+
# WORKAROUND FOR CONVEX HULL BUG/LIMIT
# XXX small noise
import random
- def R(): return (random.random() - 0.5) * 0.001
+ def R():
+ return (random.random() - 0.5) * 0.001
# XXX small noise
for i, co in enumerate(cell_points):
-
+
# XXX small noise
co.x += R()
co.y += R()
co.z += R()
# XXX small noise
-
+
bm_vert = bm.verts.new(co)
import mathutils
@@ -259,7 +256,6 @@
# ---------------------------------------------------------------------
# MESH
-
mesh_dst = bpy.data.meshes.new(name=cell_name)
bm.to_mesh(mesh_dst)
@@ -294,7 +290,6 @@
scene.update()
-
# move this elsewhere...
for obj_cell in objects:
game = obj_cell.game
@@ -380,7 +375,7 @@
if obj_cell is not None:
objects_boolean.append(obj_cell)
-
+
if use_debug_redraw:
_redraw_yasiamevil()
@@ -414,7 +409,7 @@
mesh = obj_cell.data
bm = bmesh.new()
bm.from_mesh(mesh)
-
+
if use_interior_vgroup:
for bm_vert in bm.verts:
bm_vert.tag = True
@@ -446,7 +441,6 @@
for bm_face in bm.faces:
bm_face.hide = False
-
bm.to_mesh(mesh)
bm.free()
Modified: trunk/py/scripts/addons/space_view3d_copy_attributes.py
===================================================================
--- trunk/py/scripts/addons/space_view3d_copy_attributes.py 2012-09-26 20:57:00 UTC (rev 3790)
+++ trunk/py/scripts/addons/space_view3d_copy_attributes.py 2012-09-26 21:23:02 UTC (rev 3791)
@@ -748,7 +748,6 @@
return self._end(context, {'FINISHED'})
-
def _end(self, context, retval):
if context.mode != 'EDIT_MESH':
# Clean up by returning to edit mode like it was before.
Modified: trunk/py/scripts/addons/ui_translate/utils.py
===================================================================
--- trunk/py/scripts/addons/ui_translate/utils.py 2012-09-26 20:57:00 UTC (rev 3790)
+++ trunk/py/scripts/addons/ui_translate/utils.py 2012-09-26 21:23:02 UTC (rev 3791)
@@ -162,7 +162,7 @@
k &= src_to_msg[src_enum]
msgmap["enum_tip"]["key"] = k
rtip = getattr(obj, msgmap["rna_tip"]["msgstr"])
- print("rna tip: %r" % rtip )
+ print("rna tip: %r" % rtip)
if rtip:
k = ctxt_to_msg[BLF_I18NCONTEXT_DEFAULT].copy()
if k and rtip in msgid_to_msg:
More information about the Bf-extensions-cvs
mailing list