0
$\begingroup$

So after searching for quite a while how to have my camera focus some specific object while the camera moves through space I found the very easy solution of the "Track To" object constraint.

This constraint does the job just fine, but now I wanted to extract the "new" rotation of the camera after being moved and still focusing the target and stumbled upon the problem.

After being moved, the tracking camera object's rotation isn't updated. Is there a way to access thew new rotation due to the "Track To" constraint?

I did not add a minimal example as it's less about a specific problem or a blend file and more about the nature of the Track To constraint. I did search the constraint's features, but none seem to give the actual rotation. I would prefer to access the rotation through the Python API but if you point me to where it's in the GUI, I'm sure I can figure out the rest on my own.

Thanks in advance for any help!

$\endgroup$
0
$\begingroup$

ObjectMatrixWorld.to_euler()

Proof using the console:

>>> C.active_object.matrix_world.to_euler()
Euler((1.5707963705062866, -0.0, 0.0), 'XYZ')
>>> import math
>>> math.degrees(1.5707963705062866)
90.00000250447813
$\endgroup$
1
  • $\begingroup$ Thank you very much, that seems to be exactly what I searched for. I was unaware of the object's matrix components, the object rotation components were a bit of a red hering, I guess. $\endgroup$ – Megamind Mar 31 '20 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.