0
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ Can you show some of your work in a Blender screen capture with a text editor window? $\endgroup$ Apr 5, 2019 at 1:05
  • $\begingroup$ Please see related on the right side of this web page. $\endgroup$ Apr 5, 2019 at 1:06

1 Answer 1

1
$\begingroup$

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)
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .