Anim8or Community

General Category => ASL Scripts => Topic started by: rellik420 on November 10, 2010, 03:42:58 pm

Title: automated bones
Post by: rellik420 on November 10, 2010, 03:42:58 pm
just a thought.

is it possible to program bones to do a certain function?

my idea is to have a bone do something (such as sway) linked up with the frames.

you could simulate things such as wind by having the bones 'move' until the commanded 'stop' at a certain keyframe.

hopefully this is enough info for you to grasp what im getting at.

(after seeing raxx's new program i honestly think almost anything can be done in anim8or.)
Title: Re: automated bones
Post by: davdud101 on November 24, 2010, 08:38:54 pm
Wait would that include like clothes waving by wind? So like ragdoll physics?
Title: Re: automated bones
Post by: rellik420 on November 26, 2010, 06:32:54 pm
sort of. but what im thinking about is more along the lines of "fake" physics. i just saw someones animation (ensonique's i think) in the steampunk thread and he did the whole animation in a script.

i think if someone can lay down the ground work it shouldnt be too hard to tweak to different rigs.

but for the clothes in the wind example. you can rig the clothes and then have the script simulate the wind by moving each bone in succession. you could also have different restraints so you can have the "wind" blow heavier at different moments.

i dont know how exactly it could work but i think if you get the coordinates of all the bones for the specific thing then you can alter them pretty easily.
Title: Re: automated bones
Post by: davdud101 on November 26, 2010, 07:31:04 pm
I guess I know exactly what you mean... so like you take one bone attache to 4 others, shake that bone, then all the others follow and shake succesively... correct?
Title: Re: automated bones
Post by: Water Music on November 27, 2010, 02:51:38 am
A few months back I figured out the physics of how to do that, including inertia, momentum, spring effects, wind, and gravity but not including bone limits, collision detection, or volume correction.

Bone limits would only be annoying to include if you allowed for bounce-back at the limits, with the need to track mid-frame collisions, angle of reflection, etc.  Just too annoying.  Collision detection - I'm thinking mesh collision here - is a logical follow-through (like running fingers your hair, where the hair passively reacts to other objects rather than the motion of its parent bone); unfortunately, that is a whole other beast which was way out of my scope and skill set.  And volume correction would be handy in using a passive-control system for soft-body effects, but would involve fluid dynamics - which are ugly at the best of time - and would involve a rather complicated connection with the mesh/other bones/or both.

However, the rest are all relatively simple to compute.  Each element adds a force in a given direction, scaled based on various factors.  Then you just add all of the vectors to get the bone's new orientation, scale the bone back to its original length, and watch it sort itself out.  You'd need a few user-defined variables (Spring Torque/Moment of Inertia, relative strength of gravity on the bone, relative strength of wind/tide on the bone, etc.) and you would need to keep track of the position and momentum from the previous frame, but it is really a lot simpler to calculate than one might think.

I stopped working on implementing it when I heard that you can't script bone movements in Anim8or.  That meant that the only way to implement it all would be to export the model into some program where I could calculate and change the bone angles myself directly.  Fine.  However, since one would need to use another modelling program to export a rigged skeleton, and they all contain some sort of rudimentary physics engine already, this project just sort of ended its life as an interesting academic experiment with no practical use.  Just like my university days  ::).  I still think it would be a great way to get Anim8or up to speed in the physics race, but Steve would need to implement it himself.  Given how he's always being hounded for updates I thought I'd give the poor man a break and not put it forward.
Title: Re: automated bones
Post by: rellik420 on November 29, 2010, 05:13:27 pm
thats too bad. i think anim8or is by far the easiest program to use. some other programs ive been using are very frustrating because i just want to do waht i want to do but i have to read and learn some sometimes complex things.

i know that steve is the only one working on anim8or but, i think there is way too much demand for him to keep up. if i were him i would just turn it over to the comunity (at least for awhile) then come back to it when he can.

there are quite a few of you (which i assume) you like tinkering with all of the technical things as much, if not more, than 3d modeling and animating.

any who, thanks for the info.
Title: Re: automated bones
Post by: Maximilianibus on December 01, 2010, 02:53:43 pm
well.... for physics you could use crea8or or a script(no bones), just like nicke's fluid script.
Title: Re: automated bones
Post by: MeepII on December 02, 2010, 09:49:33 am

Fluid script?

What fluid script?
Title: Re: automated bones
Post by: Maximilianibus on December 02, 2010, 07:18:25 pm
well, nicke made a fluid script :P
Title: Re: automated bones
Post by: MeepII on December 03, 2010, 11:32:35 am
Liek, OGM LINK PL0X!!!111!!!one!!!!111!!!!eleven!!!1


What does it do?
Title: Re: automated bones
Post by: Water Music on December 05, 2010, 12:31:05 am
Dude, it's only about ten posts down.  Use your eyes :p

I haven't looked into manipulating the mesh directly for this sort of thing, but I'd think it would be a much more labour intensive way of going about it.  Other programs do it that way, but I don't always like the result.  Obviously you'd need to do some direct calculations on the mesh if you are going to try to prevent clipping errors (e.g. hair/cloth keeping to the outside of a person'd skin).