Newbie question

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Newbie question

Post by Genete »

The expression:

Code: Select all

bone.fAngle
returns the angle of the bone relative to its parent or the angle of the bone relative to the global coordinate system?
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post 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
User avatar
Rai López
Posts: 2243
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post 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 :roll:
...
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Thanks men! I'll use your advices!
Post Reply