Page 1 of 1
Newbie question
Posted: Sun May 20, 2007 12:23 am
by Genete
The expression:
returns the angle of the bone relative to its parent or the angle of the bone relative to the global coordinate system?
Posted: Sun May 20, 2007 3:31 am
by heyvern
That is relative to "itself" only. Including frame 0.
If the bone is rotated at frame 0 and you get "bone.fAngle" at frame 1 it will be the same value as frame 0.
However, if the parent is rotated let's say... 90 degrees and the child is rotated 0 degrees it looks like it is rotated 90 because it is in a straight line from the parent, but it's really not rotated at all.
Often I find that child bones are rotated 360 degrees... when they SHOULD just be 0. Or I find that a child is rotated 270 degrees when it should be -90 degrees. It has to do with how and when they are parented...
... or maybe that crazy "radians" thing is playing tricks on me.
I suppose this might require another script like "RotateRotate".
-vern
Posted: Sun May 20, 2007 4:30 am
by Rai López
And of course don't forget the
print () command, "print" all ALL the time and you'll know what are you obtaining and doing, if you doubt about something like that "bone.fAngle" expression just try to print it and make changes to see the results in real time, I always (or almost) have a print () line of code after any (or almost) data with I'm working, I turn it on or off when I want with that
-- comment utility to have the control and I "always" know if/when I am in the correct way... Well, at least it meant an after and before to me in my old Lua days, ohhh... what a times 
Posted: Sun May 20, 2007 9:19 am
by Genete
Thanks men! I'll use your advices!