World coordinates for verts?

Can someon give example code for how to transform the coords of a vert by the Object loc,rot,sca so that the result is the World Coords of the vert instead of the local?

Multiply by the object’s matrix:


import bpy

scn = bpy.data.scenes.active
ob = scn.objects.active

oMat = ob.matrix
me = ob.getData(mesh = True)

for v in me.verts:
     print "Local Coords", v.co
     print "World Coords", v.co*oMat

That should print out the world versus the local coords.

Great! I’ll try this out, if your correct you may be elligible for the “Allamazingbendoverbackwardpythonprogrammingaward”!