What would the script be to get the rotation of a cube printed after every frame?
-
$\begingroup$ Can you show some of your work in a Blender screen capture with a text editor window? $\endgroup$– atomicbezierslingerApr 5, 2019 at 1:05
-
$\begingroup$ Please see related on the right side of this web page. $\endgroup$– atomicbezierslingerApr 5, 2019 at 1:06
1 Answer
Using a frame change handler
This module contains callback lists
Test script. After (post) a frame change, print the local euler rotation of the cube in degrees.
import bpy
from math import degrees
def cube_rot_report(scene):
cube = scene.objects.get("Cube")
if cube:
#rot = cube.matrix_world.to_euler()
rot = cube.rotation_euler
print([degrees(r) for r in rot])
#clear the handlers
#bpy.app.handlers.frame_change_post.clear()
bpy.app.handlers.frame_change_post.append(cube_rot_report)