I tried to get the location data of a falling cube in a rigid body simulation. Therefore I added a post-frame-handler:
bpy.app.handlers.frame_change_post.append(my_handler)
and the handler should only print the location of the cube:
def my_handler(scene):
print("Post Frame Change", scene.frame_current)
cube = bpy.data.objects["Cube"]
print(f"{cube.location}")
When the animation is played (just by starting timeline animation in Blender), the location will not be updated (in Blender 3.3).
Now my question is:
How can I force Blender to update the location data?
OR
Could one read other object properties which already are updated while
calculating the rigid body simulation
(obviously this data must exist, cause they are calculated within the animation) ?
Thank you!
The blend-file of the simulation is here:
