Menu Script - Forward Moving Walk Cycle Generator

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Menu Script - Forward Moving Walk Cycle Generator

Post by heyvern »

This script will key frame forward motion of a bone layer that has a looping in place walk cycle. It is based on the distance between two foot bones. These bones can have any name. You type the names into the script. It can go in either direction, left to right, or right to left. I created it using the Character Wizard as the source for the walk cycles.

hm_walkcycle.lua.zip

Here's a video demo:



Depending on your own walk cycles, the "Step Length" value entered in the script may require some experimentation to get it right. It's not always going to work as smoothly as it does with the Character Wizard actions. I would say in general this script can get you at least 90% of the way to a complete walk cycle traveling across the screen. In some cases you still may need to tweak the layer translation.

-vern
sbtamu
Posts: 1915
Joined: Tue Dec 15, 2009 5:05 am
Location: Texas
Contact:

Re: Menu Script - Forward Moving Walk Cycle Generator

Post by sbtamu »

The script works good on my characters. :D
Sorry for bad animation

http://www.youtube.com/user/sbtamu
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Re: Menu Script - Forward Moving Walk Cycle Generator

Post by heyvern »

I plan to add in "Follow Path" to this at some point. Then you could just key the movement along a path and maintain the stride length. You can sort of do that now by hand with follow path but you have to do it by eye. I can apply the same math to the follow path percentage and have the character travel along any path.

-vern
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Re: Menu Script - Forward Moving Walk Cycle Generator

Post by ulrik »

Hi!
This is a good idea for a script, however it will not work if I have different camera track or zoom settings than the default, is there a way to in cooperate the camera settings in the script?
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Re: Menu Script - Forward Moving Walk Cycle Generator

Post by heyvern »

Are you sure?

I tested it out and camera tracking and zoom should not effect layer movement. Camera zoom and tracking effect the WHOLE document including layer translation. Can you supply a file so I can see what's going on?

-vern
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Re: Menu Script - Forward Moving Walk Cycle Generator

Post by heyvern »

Okay, yes, the camera zoom/tracking would effect the appearance of the movement, but this isn't really something that can be accounted for in the script. It would be incredibly difficult and would only work once and would not allow for changes to the camera motion later.

For example imagine if you were "video taping" a real life person walking and you zoomed and panned the video camera while they walked. It would effect the motion in 3D space in the same way. it would make the walk cycle look "odd" because the camera would be tracking and changing the motion in relation to the movement of the walking person, if the camera tracking/zooming were animated or key framed over time. If camera track/zoom were STATIC and non moving, the layer motion would be correct. If it changes over time then it would effect the appearence of the overall character motion.

I could account for this in the script but it would be a "one time time" modification specific to the key frames in the motion. If you changed the camera track/zoom after accounting for the original motion, then the walk motion would be changed again, and it wouldn't look right.

It's like if you were filming or video recording a REAL person, and the camera was on a moving dolly or crane and was FOLLOWING the movement of the person. It changes the "appearance" of the character motion relative to the camera. It's hard to explain.



-vern
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Re: Menu Script - Forward Moving Walk Cycle Generator

Post by ulrik »

I see what you mean, I was just thinking that it would be possible but I understand now, thank you for the script, it is indeed awesome! :D
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: Menu Script - Forward Moving Walk Cycle Generator

Post by chucky »

heyvern wrote:I plan to add in "Follow Path" to this at some point. Then you could just key the movement along a path and maintain the stride length. You can sort of do that now by hand with follow path but you have to do it by eye. I can apply the same math to the follow path percentage and have the character travel along any path.

-vern
Great script Vern, I haven't used it yet, but have longed for such a thing after being spoiled by AM,s 'stride length' to path feature, which was great in that 3d realm.
Thanks for kicking this off!
Post Reply