Transform Matrix Script

I’m looking to take an existing circle (or add one using a script) and then modify it with a transform matrix, all in a script.

so far I have:

import Blender
from Blender import Mathutils
from Blender.Mathutils import *
import math

textFile = open(“ellipsoid-test.txt”)

line1 = textFile.readline().split()
line2 = textFile.readline().split()
line3 = textFile.readline().split()
line4 = textFile.readline().split()

transMat = Matrix(
line1,
line2,
line3,
line4)

print(transMat)

Cir = Blender.NMesh.GetRaw(“Circle”)

Cir.transform(transMat)

Blender.Window.RedrawAll()

but it doesn’t appear to be doing anything (although I have confirmed the matrix is correct using a print statement)

Thanks for any help or advice!

Hi there!

You cannot use any matrix for object’s matrix in Blender!!! The rotation part of it (rotation matrix) shall be a special orthogonal matrix!!! You may want to google around for “rotation matrix” and “special orthogonal matrix” to see what matrix properties you need to ensure prior to use it in Blender properly.

Regards,


EDIT - sorry, repeated message!