Setting Quaternion from HPB
-
On 09/05/2016 at 06:57, xxxxxxxx wrote:
Now that Cinema has quaternion object for Python, I've tried to use it and set it from HPB euler rotation, using Quaternion.SetHPB method.
For some reason all I'm getting back is None. Is it a bug? Am I calling it wrong way? I'm fairly new to Python so I have no clue.
Thanks for any guidance
Here's my primitive code example:
\> import c4d \> \> rot = c4d.Vector() \> \> print rot \> \> #rotq = c4d.Quaternion().SetHPB(rot) \> \> q = c4d.Quaternion() \> \> rotq = q.SetHPB(rot) \> \> print rotq
**
**
"rot" prints Vector(0,0,0) as intended,"rotq" prints None
The chained approach doesn't work either. -
On 09/05/2016 at 07:48, xxxxxxxx wrote:
Hi,
Quaternion.SetHPB() doesn't return any value. (Look at its documentation.)
SetHPB() is a setter method that calculates a quaternion direction vector and rotation angle from a HPB totation. So you should just print the q variable. -
On 09/05/2016 at 08:24, xxxxxxxx wrote:
Thank you very much, I didn't recognize the pattern. Thanks for a quick reply!