Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | sparrow_alto |
I need to retrieve a list of all of the vertices which are transformed by any given blend shape. To do this, I’m applying the blend shapes and keeping track of which vertices changed. However, it seems like global_transform.xform() just returns a vertex position from the base mesh, without taking blend shapes into account. Here’s a simplified version of my code in case I’m doing something wrong:
func _ready():
var MDT = MeshDataTool.new()
MDT.create_from_surface(mesh, 0)
var old_verts = []
var new_verts = []
for v in MDT.get_vertex_count():
old_verts.append(global_transform.xform(MDT.get_vertex(v)))
set_blend_shape("Blend Shape 1", 1) # this function just sets a blend shape's value
for v in MDT.get_vertex_count():
new_verts.append(global_transform.xform(MDT.get_vertex(v)))
for v in old_verts.size():
if old_verts[v] != new_verts[v]:
print("!") # this never happens, so old_verts must be identical to new_verts