Yeeeeeehaaaaa!
http://www.lowrestv.com/moho_stuff/scripts/springs1.mov
http://www.lowrestv.com/anime_studio/sc ... prings.zip
Name bones with ".spring" at the end.
For now make sure you create them IN ORDER from top to bottom. You can add more to this chain. I will fix this later by adding in a check for a number in the name of the bone designating the order in the chain.
I am continuously amazed at how easy this is.
-vern
More scripted physics - SPRINGS!
Moderators: Víctor Paredes, Belgarath, slowtiger
More scripted physics - SPRINGS!
Last edited by heyvern on Sat Mar 07, 2009 5:57 pm, edited 1 time in total.
- funksmaname
- Posts: 3174
- Joined: Tue May 29, 2007 11:31 am
- Location: New Zealand
- Banterfield
- Posts: 138
- Joined: Tue Aug 03, 2004 10:40 pm
- Location: Colorado
I'm still working on these scripts. I am also taking a stab at converting the Box2D stuff... much more complex. I am taking a short break while I work on my ASP Advanced Techniques web site.
Yes, I do plan to put in some way to key frame or "turn off" the physics. I was thinking of a "start physics key" and and "end physics key" for the bone. Everything between the two frames would be controlled by the script. The only problem is the last key would not be "exact". The last keyed position would be the result of the last position of the physics.
What I mean is, if you are on frame 0 and jump to frame 12 that is where the physics would start. But if you play the animation from frame 1 it starts there. The physics are based on the current position and it doesn't know what has happened before that frame. I don't even know if it would be possible to calculate the previous positions... yikes!
This could realy mess up a "stop physics" frame. It would keep changing if you scrub through the animation, constantly changing the last position unless you always play through from the first frame. I would like it to be "fixed". If you scrub backwards the physics still run forwards if you follow me.
I am thinking that it might be best to have an option to use at the very end to "bake" the physics into key frames (probably a menu script). Then remove the physics script and they wouldn't be used anymore and it would work like an "ordinary" animated bone layer.
You could always go back and delete the key frames and start over without losing anything.
So many issues to resolve.
-vern
Yes, I do plan to put in some way to key frame or "turn off" the physics. I was thinking of a "start physics key" and and "end physics key" for the bone. Everything between the two frames would be controlled by the script. The only problem is the last key would not be "exact". The last keyed position would be the result of the last position of the physics.
What I mean is, if you are on frame 0 and jump to frame 12 that is where the physics would start. But if you play the animation from frame 1 it starts there. The physics are based on the current position and it doesn't know what has happened before that frame. I don't even know if it would be possible to calculate the previous positions... yikes!
This could realy mess up a "stop physics" frame. It would keep changing if you scrub through the animation, constantly changing the last position unless you always play through from the first frame. I would like it to be "fixed". If you scrub backwards the physics still run forwards if you follow me.
I am thinking that it might be best to have an option to use at the very end to "bake" the physics into key frames (probably a menu script). Then remove the physics script and they wouldn't be used anymore and it would work like an "ordinary" animated bone layer.
You could always go back and delete the key frames and start over without losing anything.
So many issues to resolve.
-vern