Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Animation (https://simplymaya.com/forum/forumdisplay.php?f=14)
-   -   expression problem (https://simplymaya.com/forum/showthread.php?t=6712)

Darkware 04-07-2003 07:34 PM

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?

mark_wilkins 04-07-2003 08:00 PM

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

kbrown 04-07-2003 08:01 PM

You could key it all and set the post infinity to cycle. Less hassle :)

kbrown 04-07-2003 08:02 PM

lol, you beat me by one min Mark :)

Darkware 04-07-2003 09:40 PM

1 Attachment(s)
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.

kbrown 04-07-2003 09:57 PM

Cool scene mr Dark! :beer:

kbrown 04-07-2003 10:23 PM

Moved...

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


All times are GMT. The time now is 03:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018