0
$\begingroup$

I did a small simulation using ridig bodies. I would like to write (possibly to a file) the location of each object for a specified frame. Objects are spheres with different radii.

Is it possible?

I found a small script to print the location on the command line, but it doesn't seem to work:

sphere=bpy.data.objects['Sphere01']
bpy.context.scene.frame_set(50)
print(sphere.location)

It always returns the location corresponding to the initial frame (start).

Any help?

$\endgroup$
1
  • 1
    $\begingroup$ Can you try two subsequent calls to frame_set() and print(sphere.matrix_world.translation)? $\endgroup$
    – CodeManX
    Commented Sep 15, 2014 at 18:45

1 Answer 1

2
$\begingroup$

You have to store the animation data first. Like using the bake action function: object->animation->bake actions...

$\endgroup$
1
  • $\begingroup$ The animation data must already be stored somewhere (i.e. the rigid body cache), otherwise blender wouldn't know where the objects are at all.. $\endgroup$
    – gandalf3
    Commented Sep 15, 2014 at 18:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .