How can I find the vertex locations when the vertices of a cube are controlled by bones of an armature? This parenting thing is causing my regular setup to break.
I found this post, but struggle with applying it, anybody got an idea how to tackle this one?: Does a child object inherit the matrix from the parent?
# Cube, verts are controlled with hooks / empties
target_object = 'Cube'
def vertex_loc_iter():
target = bpy.context.scene.objects.get(target_object)
vertices = target.data.vertices
for vertex in vertices:
localmatrix = vertex.co
worldmatrix = target.matrix_world
location = worldmatrix @ localmatrix
yield location
for vertex in vertex_loc_iter():
print ('vertex', vertex)