Feb 2002
1 / 15
Feb 2002
Mar 2002

Hi there,
I am trying to animate an ant, all the things are complete and the model is ready setup with IK. Now I want the antennas to move in a realistic manner when the ant is moving or when it comes to stop.

Meaning when the ant is standing and when it starts to move there is a DELAY in the antennas as they move along with the ant cause of inertia. The antennas will move with a delay time period. How do I achieve this. Is it possible thru editing the weights of the CV's etc.

Please Help Thanx.

  • created

    Feb '02
  • last reply

    Mar '02
  • 14

    replies

  • 2.1k

    views

  • 1

    user

  • 2

    links

Solution1 - :

Well, the first solution is to use softbody SplineIK with springs. This however would be almost entirely automatically animated, meaning that you would have very little control. So you would not be able to create specific poses as well as let the softbody dynamics run. You can get around that by animating the weight of the softbody and using shape animation on the spline. However, this is very combersome.

solution 2 - :
This is gonna sound a little complicated, but it ain't really, and works very well. Firstly, heres the big key to all delay systems and flocking systems :

you need to tell the computer, via an expression, that one joint will match the rotation of the root joint, so many frames behind. So, here is a simple example :

float $offset = 1.5;
j2.rotateX = getAttr -t (frame - $offset) j1.rx;
j2.rotateY = getAttr -t (frame - $offset) j1.ry;
j2.rotateZ = getAttr -t (frame - $offset) j1.rz;

you will need a different offset for each joint to create fluid like delaying motion, so effectively, one joints rotation follows from the previous. You can right a simple mel script to create the expression rather than type it all out yourself.

What I find quite useful is to add an interactive stiffness control. This is very simple. Rather than create a specific different offset for each joint, you can make the offset value simply an attribute of another object or e.g. the translation in Y axis of a locator, and then add a different multiplyer for each joint instead. This way, you can animate easily when you want the flowing joints to be stiffer or floppier or even more turbulent as if being blown by wind. e.g :

float $offset = locator1.ty;
j2.rotateX = getAttr -t (frame - $offset) j1.rx;
j3.rotateX = getAttr -t (frame - ($offset * 1.5)) j1.rx;
j4.rotateX = getAttr -t (frame - ($offset * 2)) j1.rx;
etc etc

now this obviously won't give you accurate control of the tenticles enough to set specific poses. So what you can do is combine the follow value with IK. In brief, create an IK handle for each joint to the next, group each one individually and move the group-pivots to the end of each joint. Now create a particle object snapped to each joint. It will have to be multiple particle shapes with just 1 particle each. Match the pivots of each particle to each IKhandle. Now you need to obtain the worldposition of each particle (not the shape node) which you can do through another expression ...if you need that expression, email me. Now all you need do is exchange the rotation attribute in the "follow" with translation instead, and rather than set the joints to rotate, you will now be using the particles translation instead. So, the particle placed at joint 3 will follow the particle at joint 2 and 1 respectively, etc etc. You now need to constrain the group nodes of each IK handle to the individual particles using the worldpositions.

All you have to do to animate it now, is to animate the particle at the end of joint1, which will move with the body if parented to the head joint for example. The tenticle will now flow fluidly and believably, you have direct control of the floppy/stiffness as well as the stretchiness (for cartoony effects) and to set a specific pose, all you need do is animate the particleShape nodes that are parents to the particles. Et Voila :slight_smile: Have fun and experiment.

~Pootang the Great~

Hmm great but it works better without geattr so its much speedier to store the position of your frame in question for future use thisway you can get an ample speed boost...

this is however more painfull to do!

:wink: ...had to start him off...no point givin it all away, that would be far too easy and no-one would learn anything :slight_smile:

~Pootang~

Hi pootang big stuff,
anywya its going to take some time for me to digest it bit by bit, since i am newbie, but anyway thanx a lot for ur help,

Hi, potang
This is what I have devised, see wether it makes any sense or nonsense cause anyway it didnt worked.
But I know I am on the right track.

I made a sphere named head;
I made a cylinder named ante;
the cylinder had 6 spans and 8 sections;
I selected individual CV's from the corresponding rows of the cylinder from top to botom and created clusters and named them one..two..three.....upto six.
I parented the cylinder to the sphere.
Then I wrote this mel with the cylinder selected.

$offSet=4;

$deltaZ5=five.tz-four.tz;

if ($deltaZ5 >= $offSet) {
five.tz=five.tz-($deltaZ5/5);
}

Logic.
What I thought was that I will try to move the clusters indiviually depending upon how far the cluster lying immediately below it, moves away from the present Z position or X position or Y position.

Like at any given time suppose all the clusters lie at the same Z position and when i move, say cluster five in Z, the variable delta records the diff between cluster 5 and cluster 4 and when the diff becomes more then a predifned stiffness property say, offSet, the cluster 4 starts to move by a fraction of delta till again delta becomes 0.

So when I move the sphere the cylinder moves and then starts the movment of all the clusters one by one.

But that didnt happened at all.

Right, well, firstly you need to be using correct syntax as follows :

$offSet=4;

$deltaZ5=(five.tz-four.tz);

if ($deltaZ5 >= $offSet) {
five.tz -= ($deltaZ5 / 5);
}

however, this is not gonna create any lag or follow, as you need to incorporate a time control, i.e. a frame offset expression as I showed you. Of course you could also animte your offset value instead, however, the expression you have written will affect all the clusters at once. What you could try is assigning all your clusters to an array and writing an expression that will assign an incremented offset to each cluster. Algorythm would be ; for $clusters[]
{
// your procedure here//
}

Secondly, shifting around clusters like that is not gonna work, cos it won't account for the rotations. You can put that in, but you would also have to add in a directional control using the cluster normals, so that they face eachother all the time as opposed to sliding across eachother.

Thirdly, and most importantly, what you are attempting to do is essentially create your own controllable softbodies. To a degree you can do it by using maya soft bodies and painting wieghts, and adding springs. However, this still won't give you control enough to pose the antennas if you want to. Which is why your better off in this case using Ik and applying a system like that which I explained earlier. However, there is another alternative you can try, that you might like. It is basically the system you have just tried to implement, already working and bug free. If you've ever used softimage you'll know it. In softimage its called the QuickStretch. Its been reprogrammed into Maya4 and if you are using Maya3 it is on Highend3d as a mel script.
Its very good. Its almost like real-time softbodies. Very quick. It basically animates lag on cv's just like your tryin to do. And it will even let you paint the lag valus along your tentacle.

Have fun.

Pootang :slight_smile:

thanx a lot for that correction but I coudnt find teh mel here I tried searching for it in all the sections of highend and even thru the WWW thru google but in no vain.

Hi pootang thanx for that neat correction, I did try finding the quickstretch mel in highend3d and aslo on www but I coudnt find a link, anyway I did find this link,http://www.iro.umontreal.ca/~roys/softimage_xsi/files/docs/html/model/qstretch.htm
which gives u an idea of how quickstrethc works in softimage and how it is used but how do i obtain the mel on it.

oops, yeah it would help if you knew what it is called I suppose :wink: sorry. Its called jiggle.mel. You can find on this website under maya>mel scripts>animation. Called jiggle. And as I said, if you are using Maya 4, it is built in, in the deform>create jiggle deformer.

~Pootang The unstoppable, omni-present, omni-best, and generally dashing.....did I mention very very very bored.....time for shot on Counter Strike~

Just a note. The jiggle deformer is a different beast from the jiggle.mel. Check out both if you want, I prefer the jiggle.mel (works more or less real time, and gives you excellent control).

Ragnar

gr8, I downloaded the mel and working on it.
Thanx ragtag for the help as well hope it all wotks upto my expectations.

Anyway certain things seem funny here, when I posted my last thread I coundt see it so I again posted it this I did it again bcause I again coudnt see it and I saw all the three postings at once when I posted my third one....

Anyway....good things happen that way.