mgschwan / blensor

Blender Sensor Simulation
www.blensor.org
Other
178 stars 47 forks source link

Export motion bug #4

Closed petermoz closed 12 years ago

petermoz commented 12 years ago

Using bpy.ops to change the frame was not triggering a scene update, and even an explicit update did not cause matrix_world to be recomputed. Therefore incorrect nav data was being exported.

Recreating the problem

Make the sensor follow an animated path. Change to (e.g.) frame 20. Run export motion. The first nav solution exported will be from frame 20, not frame 1.

Fix

Use bpy.context.scene.frame_set() instead.

mgschwan commented 12 years ago

Yes motion export was always a bit tricky, because the location/rotation are not changed if the object is following a path. This was fixed by extracting the information from the matrix_world but apparently i overlooked the problem with the frame changes.

Thank you for the fix