Page 1 of 1

Gravity Star, Make a bone point in one direction

Posted: Sat Jan 30, 2010 5:18 pm
by super8mm
In this example we have a character who has a pony tail (blue bone) and we don't want to spend time animating it to make it fall to gravity when the head tilts (red bone). This is where the Gravity Star comes in. (purple bones)

The pony tail parents are the Head -> Neck -> Torso -> Ab2 -> Abdomen -> Hip. So the star will require 6 points to have the pony tail match the hip bone angle.

The Gravity Star is a cluster of bones that are all at zero offset from the pony tail bone to avoid wondering from its attached location when rotated. Each spike of the star is a controlled bone that is the opposite angle (-1) of all its parents. Thus any angle accumulations done by its parent bones are subtracted. The resulting angle of the pony tail will always be the same angle as the main parent bone.

Example anme file:
http://www.mediafire.com/?mznmcjdjjmy
Image

Posted: Sat Jan 30, 2010 10:04 pm
by Víctor Paredes
It's very clever, thanks for sharing!
It could have a lot of uses (which I haven't thought yet)!

PD: For this kind of thing I used to use the LM's hanging bone script. That script makes a bone always look down no matter the position or rotation of any other parent bone. I was looking for a solution for a necklace and Genete talked me about that little script.

!

Posted: Sun Jan 31, 2010 12:33 am
by Víctor Paredes
It's a fantastic use of controlled bones. I love it!
I'm playing with it and works perfect. Even the construction is easy and fast (I first select all the star bones and assign -1 to a single bone, then I change each star bone controller, without having to write "-1" all the time)

A great feature is you can have a bone maintaining its rotation on any angle, not just looking down. So it can be useful for many things, for example, for a bag on a character's hand or a head maintaining its point of view no matters how the body is moving. Another fantastic thing is you can animate the bone angle, so it can change on time, or even give it dynamics.

Thanks again for sharing. Genete showed some tricky fantastic things you could do using controlled bones, but I never thought in this particular use.

Posted: Sun Jan 31, 2010 12:50 am
by Genete
Really very clever and interesting!
-G

Posted: Sun Jan 31, 2010 1:19 am
by super8mm
Glad to inspire. :)

Posted: Sun Jan 31, 2010 5:59 am
by neeters_guy
I had to look your file and read your description like 6 times before it I got it. So this star setup could be added to the end of any chain of bones--eg., arm or legs--to keep a shape pointing in a constant direction? Brilliant! :)

Posted: Mon Feb 01, 2010 11:46 pm
by Onionskin
selgin wrote: PD: For this kind of thing I used to use the LM's hanging bone script. That script makes a bone always look down no matter the position or rotation of any other parent bone. I was looking for a solution for a necklace and Genete talked me about that little script.
Selgin,

where can I find that script please?

Posted: Mon Feb 01, 2010 11:55 pm
by Víctor Paredes
Onionskin wrote:
selgin wrote: PD: For this kind of thing I used to use the LM's hanging bone script. That script makes a bone always look down no matter the position or rotation of any other parent bone. I was looking for a solution for a necklace and Genete talked me about that little script.
Selgin,

where can I find that script please?
Here you have, but I'm not sure if it works with 6.1
viewtopic.php?t=1928

Posted: Tue Feb 02, 2010 12:09 am
by Onionskin
thank you selgin!

Posted: Tue Feb 02, 2010 12:24 am
by Onionskin
Yes, you are right selgin, that script is not working with 6.1 :cry:

Posted: Tue Feb 02, 2010 1:57 am
by Rai López
It should work...

That I've observed just now, thanks to the lua console window, is AS seems to have problems to navigate between paths that use some kind of spécìal chärâctér!?!? At least that cause it jumped to me with a "cannot open C:\Documents and Settings\Ramón López..." message. This is very weird and I'm pretty sure it didn't happen to me before although, OTOH, I'm not pretty sure if that really happened to me before... but, I suppose I'd remember it...

...Whatever! Have you tried to put the two files (.moho & .lua files) inside a folder named "New folder" (in example) under C: (in example) to test it? Cause that little script worths...

Posted: Tue Feb 02, 2010 10:28 am
by slowtiger
The same problem came up with some rendering issues lately. Yes, AS chokes on special characters in a path, so it's best to avoid them.

Posted: Thu Feb 04, 2010 1:13 am
by Onionskin
it works! thanks guys :D

Posted: Thu Feb 04, 2010 3:02 am
by Rai López
slowtiger wrote:Yes, AS chokes on special characters in a path, so it's best to avoid them.
Course! although I learned that lesson a bit too late... Anyway, that seams weird (to me at least) is that, as moho uses relative paths to locate things like embedded scripts, why it should get in trouble with a special character in a parent of a parent of a parent folder? If really moho doesn't take that into account and it finally saves this kind of paths: layer_script "hanging_bone.lua" into the mono file, where there is no special characters at all...

Well, sure it'll be technically logical, but I'd never have thought that had something to do with that, if it hadn't been for the Lua console clue...