0

What would the script be to get the rotation of a cube printed after every frame?

Drew
  • 1
  • 1

1 Answers1

1

Using a frame change handler

Application Handlers

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)
batFINGER
  • 84,216
  • 10
  • 108
  • 233