PDA

View Full Version : How to MEL script a spider walk-cycle...


Gremlin
12-09-2003, 01:02 AM
I know it can be done, are there any tutorials anywhere, or a script somewhere that I can check out. I get basic C++ / MEL so, if you shoot some code my way I can try and crunch through it and understand it, but I'm really going to need this for an upcoming animation. :D

Gremlin! :thumbsup:

Pixero
12-09-2003, 07:18 AM
This might be what your after:

http://www.swanimator.com/tipstutorials/riggingThroughExpressions/rigExp.htm

Gremlin
12-09-2003, 08:52 AM
hey, im kind of tired right now...
but it looks probably like its exactly what I want. thanks a lot pixero, your the master! :D

Can't wait to animate my spider mech :thumbsup:

samiujan
12-09-2003, 10:58 AM
Try this...

www.hash.com/users/threechickens/Spider.htm

Gremlin
12-09-2003, 06:47 PM
hey, thats cool... that's good to know, but now I need MEL help programming that. :hmm:

hmm, i'll have to visualize and check to see if this table will work with a 6 or 4 legged spider. either way, thnx!

Cheers,
:beer:

Kaiser_Sose
12-09-2003, 11:13 PM
hehe, what are the chances there was an expression rigging tutorial out there and on spiders too ... lucky

Gremlin
12-10-2003, 02:00 AM
that tutorial isn't what i want... after following all of the steps (didn't take long, just copied the MEL scripts) I found out, its for a flying 4 legged mars lander type thing...

not a realistic spider... maybe I can examin the code, and learn some tho....inching closer to making my spider rig :hmm:

dmcgrath
12-11-2003, 03:37 AM
http://www.kolve.com/mp_brainbugz/brainbugz.htm

Best one I have seen so far.

And you can also try

www.simplymaya.com

check their forums for spider walk or something like that.

Gremlin
12-11-2003, 06:05 AM
Hey, that script has nothing relating to the spider walk cycle...it just controls the spider's walk path, but i still appreciate it, as I am emailing that person about the script used. :D

Pixero
12-11-2003, 07:26 AM
Heres a funny Spider walk referens I stumbled across:
http://funwg.bei.t-online.de/java/walk/

Gremlin
12-11-2003, 07:35 AM
heheh, now see I can script that... thats not quite accurate, cause the legs that go up in one "step" go up sequencially... which is what's giving my problems in maya.

i need to know how to in essence do this:

left_leg2.ty = (getAttr (right_leg1.ty @ (time-2)));

i want what the right legs y-axis translation was, 2 seconds ago.... that way, the second leg will raise 2 seconds afterwards in this example...
(im reality, 2 seconds would be quite a long time)

so, does anyone know how to do this? the problem with my code above, is the keyword time is a scalar, its not a dynamic quantity. if its been 3 seconds, (time-2) would give you 1... yet, what i want, is the translation when it was at frame 1... not a value of one, cause that would make the y translation 1, when at frame 1, the driving leg coulda been at 10 units translated in the y....

UGHH!!! :cry:

Pixero
12-11-2003, 03:36 PM
Theres a MEL script at highend 3d called Copycat that lets you offset based on frames. If you just animate one step on one leg you can easily offset the other legs. Ive tried it for a spider.

stew
12-11-2003, 05:03 PM
Offsetting keyframes is pretty simple, I did something similar in MaxScript a while ago. I used that to animate caterpillars.
Still, you need to animate at least one leg, but that's a lot better than 8!

[edit]D'oh, I should read more thoroughly - you covered that already. Sorry for the redundant post.

Gremlin
12-11-2003, 10:00 PM
Hey, i'll check out that script...

what i wanted to do, was have the movement of the body drive the animation of the first leg, and then have the copycat thing make the other legs move.

i'll test it, and let you know.

Gremlin
12-12-2003, 02:44 AM
uhh, copycat.mel isn't working... sourced it, and tried to run it, didn't find it. then I manually chose to open script, and it lots all the code, no errors, bu no window pops up like the readme says. :surprised

Pixero
12-12-2003, 03:01 PM
Copycat works for me. Just source it and write Copycat; in script editor and press enter.

Anyway, I managed to make a automatic spider with set driven keys. Just move the body and all the legs move. Its not perfect but works in both x and z.
Here a small sample movie I rendered:

Spiderwalk (divX) (http://w1.702.comhem.se/~u70208061/bilder/pics/spider01.avi)

Gremlin
12-13-2003, 01:40 AM
wait dude, how did you do that?

and second, my copycat doesnt want to work... if source it, nothing happens, if i open the script in the script editor, it just gets entered, but the window doesn't pop up. :argh:

Pixero
12-13-2003, 10:42 AM
Have you sourced it first and then written Copycat; in scripteditor and pressed enter? That works for me every time.

The way I did it with setdriven keys doesnt need the script though. A script thats using time only works when keyframes are set and animation playbacked while setdriven keys works in the viewport when you drag it around.

I made a little tutorial here:

Automatic spider with set driven keys (http://www.sandstrom.on.to/)

Hope this helps and let me know if anything is still unclear.

Gremlin
12-13-2003, 12:17 PM
bah.... doing it your way somehow worked, LOL... so my copycat works, and its kickin' ass. Just what I wanted... and your tutorial looks tight too. I'll check out both when i finish the spider model :D

CGTalk Moderation
01-16-2006, 10:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.