reading motion works in console but not in script

Hi,

I’m currently trying to export motion in 2.5. It seems I’m doing it wrong though.

If I enter this script line by line in the interactive python console (which I love by the way) it works just fine, but if I run it as a script it always prints the location at frame 0… :confused:

import bpy

bpy.context.scene.frame_current = 0
print(bpy.context.selected_objects[0].location)
bpy.context.scene.frame_current = 1
print(bpy.context.selected_objects[0].location)

Setting the location works this way though… I’m confused.

Any help is appreciated,
Mr. Wonko