I’m trying to update a script I’m writing to 2.40 and I used to use the depricated MatMultVec() and VecMultMat() functions. They no longer work and so I replaced them with the simpler vec * mat syntax. I’ve tried all kinds of things, but can’t get it to work correctly. All I want is a simple transformation. Here’s the code:
import math
from math import *
import Blender
from Blender.Mathutils import *
p = Vector(0.0, 0.0, 0.0)
transMatrix = TranslationMatrix(Vector(0.0,15.0,0.0))
print 'pBefore:', p
print 'transMatrix: ', transMatrix
p.resize4D()
p2 = transMatrix * p
print 'pAfter: ', p2
If anyone with 2.40 can try this out and let me know if I’m doing something wrong that’d be great! Incidentally someone else seems to be having a similar problem:
Thanks for the reply, but I’m not sure how that makes a difference. I thought the 4th number in the vector had no effect and is thrown out anyway if I resize3D() afterward.
Either way, the first 3 numbers (x, y, z) are the only ones that really mean anything, and the y value should be changed to 15.0 in this situation.