I am trying to capture the mesh of an object modified by an armature. Below is an image of the object before being modified by the armature. The object is parented to the armature using "Armature Deform with Automatic Weights".
I'm using this code below that uses a bmesh to try and capture the new mesh of the transformed object.
import bpy import bmesh context = bpy.context ob = context.object dg = context.evaluated_depsgraph_get() bm = bmesh.new() bm.from_object(ob, dg) # Create new mesh me = bpy.data.meshes.new('myMesh') # Create new object obj = bpy.data.objects.new('myObject', me) #ob.location = origin ob.show_name = True # Link object to scene bpy.context.collection.objects.link(obj) # Finish up, write the bmesh back to the mesh bm.to_mesh(me)
For example below is an image of the transformed object and the new object using the transformed mesh. The new object is lying at the foot of the transformed object. I expected both objects to look the same. What am I missing here?