Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python for Blender - access mesh animated vertices location data
import bpy
import bmesh
obj = bpy.context.active_object
frames = range(0,10)
# get the object's evaluated dependency graph:
depgraph = bpy.context.evaluated_depsgraph_get()
# iterate animation frames:
for f in frames:
bpy.context.scene.frame_set(f)
# define new bmesh object:
bm = bmesh.new()
bm.verts.ensure_lookup_table()
# read the evaluated (deformed) mesh data into the bmesh object:
bm.from_object( obj, depgraph )
# iterate the bmesh verts:
for i, v in enumerate(bm.verts):
print("frame: {}, vert: {}, location: {}".format(f, i, v.co))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.