[Bf-python] Python export of local rotation in degrees

Campbell Barton ideasman42 at gmail.com
Thu Jul 5 13:56:28 CEST 2012


Does this help?

eul = Euler(xyz)
eul_deg = [math.degrees(axis) for axis in eul]

Alternately we could have...

eul.to_degrees() --> (x, y, z)

functionally equivalent to...
def to_degrees(eul): return tuple([math.degrees(axis) for axis in eul])

... returning a tuple rather then a euler object so someone doesn't
try to convert it to a matrix or so - where degrees wont make sense.

On Thu, Jul 5, 2012 at 1:26 PM, Herbst, Mathias  SX1HZA-AOES
<herbsmth at schaeffler.com> wrote:
> Hey guys,
>
> I've set up a tracking scene with a tracked moving object, while the camera
> is also moving. I would like to extract the information about the local
> rotation in degrees of my object. Therefor I've inserted a cube constrained
> to the Object solver. The exact information I'm looking for looks like the
> values of the rotation of my cube in the 3D Viewport when you change the
> constraint of the Object solver to an F-Curve.
>
> I've been looking for something like what
> bpy.data.objects['Cube'].matrix_local.to_translation() is to translatory
> movement for rotary movement in the documentation as well as in the console
> itself.
> What I found was the .to_euler() function. However, I need the rotation in
> degrees. Of course I could implement my own transformation to the degree
> values but I think there should be a blender or even a python function for
> that and I'm just unable to find it or maybe there is a much easier way to
> get the information.
>
> Sorry to bother you with this. I would be greatful for any help on the
> matter.
>
>
> Best regards
> Mathias
>
>
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



-- 
- Campbell



More information about the Bf-python mailing list