updated py scripts for changes in mathutils

This commit is contained in:
Campbell Barton 2006-07-27 03:15:37 +00:00
parent 403b62fbcf
commit 3f5e14abef
6 changed files with 8 additions and 14 deletions

@ -314,10 +314,7 @@ def process_next_chunk(file, previous_chunk, importedObjects):
def putContextMesh(myContextMesh, myContextMeshMaterials):
INV_MAT= Blender.Mathutils.Matrix(contextMatrix)
INV_MAT.invert()
contextMesh.transform(INV_MAT)
contextMesh.transform(contextMatrix.inverted())
materialFaces= set()
# Now make copies with assigned materils.

@ -85,9 +85,9 @@ def add_to_NV(old,dir,new):
def get_v(old, *neighbors):
# compute the direction of the new vert
if len(neighbors) == 1: dir = (neighbors[0].co - old.co).normalize()
if len(neighbors) == 1: dir = (neighbors[0].co - old.co).normalized()
#dir
else: dir = (neighbors[0].co - old.co).normalize() + (neighbors[1].co-old.co).normalize()
else: dir = (neighbors[0].co - old.co).normalized() + (neighbors[1].co-old.co).normalized()
# look in NV if this vert already exists
key = tuple(dir)

@ -1043,10 +1043,7 @@ def pointInsideMesh(ob, pt):
else:
return False
obImvMat = Blender.Mathutils.Matrix(ob.matrixWorld)
obImvMat.invert()
obSpacePt = pt*obImvMat
obSpacePt = pt*ob.matrixWorld.inverted()
ray = Vector(0,0,-1)
me= ob.getData(mesh=1)

@ -44,7 +44,7 @@ def mouseViewRay(screen_x, screen_y, localMatrix=None, useMid = False):
# sorry - i cannot explain here what they all do
# - if you're not familiar with all those matrices take a look at an introduction to OpenGL...
pm = Window.GetPerspMatrix() # the prespective matrix
pmi = Matrix(pm); pmi.invert() # the inverted perspective matrix
pmi = pm.inverted() # the inverted perspective matrix
if (1.0 - epsilon < pmi[3][3] < 1.0 + epsilon):
# pmi[3][3] is 1.0 if the 3dwin is in ortho-projection mode (toggled with numpad 5)

@ -109,7 +109,7 @@ def vertexGradientPick(ob, MODE):
cross_grad= CrossVecs(DirectionA, OriginA-OriginB)
ORTHO= True
cross_grad= cross_grad.normalize() * 100
cross_grad= cross_grad.normalized() * 100
lineA= (OriginA, OriginA+(DirectionA*100))
lineB= (OriginB, OriginB+(DirectionB*100))

@ -74,8 +74,8 @@ class edgeLoop:
# Use next and prev, nextDist, prevDist
# Get Loops centre.
fac= 1.0/len(loop)
self.centre= reduce(lambda a,b: a+b.co*fac, loop, Mathutils.Vector())
fac= len(loop)
self.centre= reduce(lambda a,b: a+b.co/fac, loop, Mathutils.Vector())
# Convert Vert loop to Edges.
self.edges = []