Greetings Python masters, i am seeking your help with one script, since my skill in python equals 0.
I am trying to export Location, Rotation and Scale values from F-Curve key frames.
The data will be used to create animations for the Warzone 2010 game.
This is the script i found and modified by adding obj.rotation_euler and obj.scale.
mport bpy
scn = bpy.context.scene
obj = bpy.context.active_object
for f in range(scn.frame_start, scn.frame_end+1):
# use frame_set() so that keyed values are updated
scn.frame_set(f)
print(scn.frame_current, obj.location, obj.rotation_euler, obj.scale)
The output looks like this:
<Vector (0.0000, 0.0000, 0.0000)> <Euler (x=0.0000, y=0.0000, z=0.0000), order=‘XYZ’> <Vector (1.0000, 1.0000, 1.0000)>
1 <Vector (0.0067, 0.0000, 0.0017)> <Euler (x=0.0000, y=-0.0117, z=-0.0000), order=‘XYZ’> <Vector (0.9990, 1.0000, 0.9990)>
2 <Vector (0.0268, 0.0000, 0.0071)> <Euler (x=0.0000, y=-0.0335, z=-0.0000), order=‘XYZ’> <Vector (0.9990, 1.0000, 0.9990)>
3 <Vector (0.0600, 0.0000, 0.0172)> <Euler (x=0.0000, y=-0.0755, z=-0.0000), order=‘XYZ’> <Vector (0.9990, 1.0000, 0.9990)>
4 <Vector (0.1058, 0.0000, 0.0337)> <Euler (x=0.0000, y=-0.1345, z=-0.0000), order=‘XYZ’> <Vector (0.9990, 1.0000, 0.9990)>
Here are my questions:
1, Is it possible to add one more decimal value to location ? for example 0.00672 instead of 0.0067
2, How could i add recalculation of rotation from radians to degrees in the script?
I am grateful for any advice or documentation link.
My Best Regards,
Astorian