I'm making simulation in blender for rigid body. I need object location in the current frame. I use following command


but this command returns the location corresponding to the initial frame. Neither changes object location in Location panel during simulation. I know I can bake rigid body transformations to keyframes but I need another way to get location of object because baking takes long time for multiple objects. Is there any other command which can print object location after transformation without baking?


Yes, Location/Rotation/etc. returns the values visible in relevant fields of the object transform in the UI, kind of 'initial' transformation. To get final one, you can use:


Note that:

  1. This gives you absolute position of the object (world space), if you want its relative position (to parent e.g., local space), you'll have to use matrix_local.
  2. You should bake physics simulation before using frame_set().
  • $\begingroup$ Thanks so much. I actually used this to export a model after doing physics simulations for. $\endgroup$ – Amir Sep 1 '16 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.