I have a riggify armature named “rig”, and I have an object “Tekko Kagi L” that is constrained to rig’s DEF-hand.L using an Armature modifier, as shown in the first screenshot.
When I render my animations, I also try to export the world space position of this object each frame to a JSON file using bpy.context.scene.objects["Tekko Kagi L"].matrix_world.to_translation()
. However, regardless of rig’s pose, this line always returns the same position.
If I delete the armature modifier and instead use an object parenting relation like in the screenshot below, the script does return different values with different poses. However, I would rather not have to manually reposition the object, as would be required to set it up this way (my test had it very lazily aligned).
So my question is, how can I get the world space translation (and rotation) of “Tekko Kagi L” while still using the Armature modifier instead of the object relation? Or alternatively, is there a way to Apply the modifier as an object relation?