Applying scale and rotation from a script?

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Tue May 08, 2007 10:09 pm

Applying scale and rotation from a script?

Post 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)


Posts: 0
Joined: Sat Mar 12, 2005 2:56 pm
Location: Abilene, KS

Post 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.

A three-legged stool never wobbles.

Post Reply