Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 1 04-07-2003 , 07:34 PM
Darkware's Avatar
Subscriber
Join Date: Oct 2002
Location: USA
Posts: 1,172

expression problem

As some of you may very well know, I stink at expressions and the like. Here's what I want done:

Locator will move only on the x and y axis. For 20 frames tx and ty are 0. Ten frames later, ty increases to 2. Ten frames later, tx increases to 8 and ty decreases to 0.

Here's the tricky part. I need all this to repeat -> repeat from the frame at which it ended if you can understand that.

If you do what I said above, you will end up at frame 40. So, from frame 41 to 61 (20 frames) tx is 8 and ty is 0. Ten frames later, ty increases to 2. Ten frames later, tx increases to 16 and ty decreases to 0 once again.

If it's possible, I could simply key the y axis since it has the same animation every 40 frames and make it repeat itself. ANy suggestions?

# 2 04-07-2003 , 08:00 PM
mark_wilkins's Avatar
Registered User
Join Date: Jan 2003
Posts: 161
umm ok

I didn't need an expression to do this. Instead, I just

* keyframed the tx and ty curves for the first 40 frames.

* Opened the graph editor

* Picked the ty curve and selected all of its keys by dragging

* chose Curves > Post Infinity > Cycle

* Picked the tx curve and selected its keys

* chose Curves > Post Infinity > Cycle with Offset

No expressions at all, and as far as I can tell it does exactly what you want.

-- Mark


Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com
# 3 04-07-2003 , 08:01 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
You could key it all and set the post infinity to cycle. Less hassle user added image


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 4 04-07-2003 , 08:02 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
lol, you beat me by one min Mark user added image


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 5 04-07-2003 , 09:40 PM
Darkware's Avatar
Subscriber
Join Date: Oct 2002
Location: USA
Posts: 1,172
Ahh! Offset! *slaps forehead* I was thinking about keying, then setting the post infinity to one of the selections, but I figured it would just keep making tx go from 0 to 8 repeatedly. With offset however, it does just what I want it to. I forgot all about it. lol!

Ok, so here's what it looks like in action. I have a four-legged spider with IK handles. Each IK handle is parented to a locator. The root joint is run by a simple expression (tx = frame * .2; I think) and the locators have four keys each with post infinity set to cycle offset. Very basic walk cycle.

The mb file is attached. (74.6 kb)

Thankyou kbrown and Mark! I don't know what I'd do without you two.

EDIT* Ok, I just noticed a problem. 900 frames into the walk the legs seem to get ahead of the body. This had to do with the tx value of certain keys being miscalculated by me. The problem is now fixed and I have uploaded a new file.

There is one other problem I'm not entirely sure how to fix though. The left hind leg extends too far during the walk. It's perfectly straight when this happens. You can rekey the locator and bring it forward a bit, but doing this messes up the leg in the long run. Any suggestions on that?

Also, since this has turned into more of an animation thread, a moderator can feel free to move this to the animation board if they like.

Attached Files
File Type: mb spiderwalk.mb (74.6 KB, 215 views)

Last edited by Darkware; 04-07-2003 at 10:01 PM.
# 6 04-07-2003 , 09:57 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Cool scene mr Dark! user added image


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 7 04-07-2003 , 10:23 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Moved...

I didn't check the scene this time but have you tried limiting the joint rotations?


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads