Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-07-25 06:13:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-25 06:13:55 +0400
commit0b79556dc65be03333761c2e2c0cc5aa095978b6 (patch)
treead7f5e8ade73a2b30022d18d8baad6c19ced5acf /add_mesh_BoltFactory
parentf7ed59065a9069de777e4957f48650d72bd2a400 (diff)
make bolt factory use reversed vector rotation order,
also use LC's for Rot_Mesh and Copy_Faces functions.
Diffstat (limited to 'add_mesh_BoltFactory')
-rw-r--r--add_mesh_BoltFactory/createMesh.py28
1 files changed, 9 insertions, 19 deletions
diff --git a/add_mesh_BoltFactory/createMesh.py b/add_mesh_BoltFactory/createMesh.py
index bceb4ebd..2b6f9dea 100644
--- a/add_mesh_BoltFactory/createMesh.py
+++ b/add_mesh_BoltFactory/createMesh.py
@@ -18,12 +18,11 @@
import bpy
+# ???, why do this
try:
- import mathutils
- MATHUTILS = mathutils
+ import mathutils as MATHUTILS
except:
- import Mathutils
- MATHUTILS = Mathutils
+ import Mathutils as MATHUTILS
@@ -175,23 +174,14 @@ def Get_Phillips_Bit_Height(Bit_Dia):
##########################################################################################
# Returns a list of verts rotated by the given matrix. Used by SpinDup
-def Rot_Mesh(verts,matrix):
- ret = []
- #print ("rot mat",matrix)
- for v in verts:
- vec = MATHUTILS.Vector(v) * matrix
- ret.append([vec.x,vec.y,vec.z])
- return ret
+def Rot_Mesh(verts, matrix):
+ Vector = MATHUTILS.Vector
+ return [(matrix * Vector(v))[:] for v in verts]
+
# Returns a list of faces that has there index incremented by offset
-def Copy_Faces(faces,offset):
- ret = []
- for f in faces:
- fsub = []
- for i in range(len(f)):
- fsub.append(f[i]+ offset)
- ret.append(fsub)
- return ret
+def Copy_Faces(faces,offset):
+ return [[(i + offset) for i in f] for f in faces]
# Much like Blenders built in SpinDup.