Page 1 of 1

Applying scale and rotation from a script?

Posted: Wed May 09, 2007 12:47 am
by revans
Is there an exposed function that will allow me to apply scale and rotation to a scene from python? (The equivalent of hitting Ctrl-A in non-edit mode)


Posted: Thu May 10, 2007 3:58 am
by reD_Fox
Hello, Ryan. There doesn't appear to be a function already in place to do what you want. However, it's fairly straightforward to accomplish yourself.

Code: Select all

def applyTransform(obj):
	mat = obj.getMatrix()
	me = obj.getData(mesh=True)
	for v in me.verts: =*mat
There may be a better way to accomplish this, but it's the best I can come up with. Also, you might try the forum:
It is a bit more frequented, and you may get more and/or better help there.