How can I get the translation of an object with an armature modifier?

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?

I figured out a different solution, which may be a bit janky but it works.

  1. Apply the modifier.
  2. Create a “Child Of” constraint set to rig > DEF-hand.L.
  3. Set Inverse on that constraint.

It appears that the matrix_world.to_translation() works as desired on a Constraint, so I don’t need to convert it to an Object Relation. Although I was able to do this as well with the following steps.

  1. Copy the Global Transform (under the “Animations” tools).
  2. Delete the Constraint.
  3. Paste the Global Transform.
  4. Add the Object Relation.
  5. Paste the Global Transform again.

I’ll leave the post as unsolved though, because I am still curious if what I initially wanted to do is possible.