Skip to content

Commit

Permalink
update for changes in blender.
Browse files Browse the repository at this point in the history
  • Loading branch information
ideasman42 committed Jan 9, 2011
1 parent 7fb70a4 commit ac2bcc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions add_mesh_BoltFactory/createMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ def Simple_RotationMatrix(angle, matSize, axisFlag):
q = radians(angle) #make the rotation go clockwise

if axisFlag == 'x':
matrix = MATHUTILS.Matrix([1,0,0,0],[0,cos(q),sin(q),0],[0,-sin(q),cos(q),0],[0,0,0,1])
matrix = MATHUTILS.Matrix(((1,0,0,0),(0,cos(q),sin(q),0),(0,-sin(q),cos(q),0),(0,0,0,1)))
elif axisFlag == 'y':
matrix = MATHUTILS.Matrix([cos(q),0,-sin(q),0],[0,1,0,0],[sin(q),0,cos(q),0],[0,0,0,1])
matrix = MATHUTILS.Matrix(((cos(q),0,-sin(q),0),(0,1,0,0),(sin(q),0,cos(q),0),(0,0,0,1)))
elif axisFlag == 'z':
matrix = MATHUTILS.Matrix([cos(q),sin(q),0,0],[-sin(q),cos(q),0,0],[0,0,1,0],[0,0,0,1])
matrix = MATHUTILS.Matrix(((cos(q),sin(q),0,0),(-sin(q),cos(q),0,0),(0,0,1,0),(0,0,0,1)))
else:
print ("Simple_RotationMatrix can only do x y z axis")
return matrix
Expand Down
4 changes: 2 additions & 2 deletions io_import_scene_dxf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ def getOCS(az): #--------------------------------------------------------------
def transform(normal, rotation, obj): #--------------------------------------------
"""Use the calculated ocs to determine the objects location/orientation in space.
"""
ma = Matrix([1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1])
ma = Matrix(((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)))
o = Vector(obj.location)
ma_new = getOCS(normal)
if ma_new:
Expand All @@ -1419,7 +1419,7 @@ def transform(normal, rotation, obj): #----------------------------------------

if rotation != 0:
g = radians(-rotation)
rmat = Matrix([cos(g), -sin(g), 0], [sin(g), cos(g), 0], [0, 0, 1])
rmat = Matrix(((cos(g), -sin(g), 0), (sin(g), cos(g), 0), (0, 0, 1)))
ma = ma * rmat.resize4x4()

obj.matrix_world = ma #must be matrix4x4
Expand Down

0 comments on commit ac2bcc3

Please sign in to comment.