Action modifiers for walk cycles

I’ve been trying to figure out how to use an action modifier to run a walk cycle in a curve path using a curve/path object. However, when I try to do this, the character object in Blender behaves in strange ways. I have no idea even how Blender decides how to change the location or rotation of the bones when an action modifier is used, and I can’t find information about this.

I did the things in the list of settings in http://www.blender.org/development/release-logs/blender-243/walk-cycle-modifiers/ like making sure the curve path is centered at the same global position as the armature, and setting the animation settings to -y for an object that walks in that direction. I downloaded the mancandy blend file but I still cannot figure it out, partly because I can’t find the bones foot.L and foot.R of the candyskel armature, even though both of those bones are used as channels for action modifiers.

Also at http://www.blender.org/development/release-logs/blender-243/walk-cycle-modifiers/ it says that this feature can use other modifiers, such as noise, oomph and python. I see oomph and noise in the modifier type menu, but not python. I’ve thought about using a python constraint to have the armature walk along a curve if I can’t get it to work with the action modifiers, but I think it would be better to use a python action modifier than a python constraint if that is possible.

hi 4096,

Yes, this is one thing that took me sometime to figure out. I even thought about doing a tutorial about it, but never got that far. However, I did answer this in another thread.

http://blenderartists.org/forum/showthread.php?t=166039

Read through that thread, it should help. The character has a very simple rig, and only the torso is controlled by the modifier. Additional help can also be found here…

http://blip.tv/file/720838

Hope this helps
Randy

I’ve recently been messing with walkcycles, curves and the NLA and there doesn’t seem to be one comprehensive tutorial but rather lots of them covering different aspects.

Firstly; are you using the offbone system for animating the walkcycle? That’s what I’m learning at the moment, so I’ll try and explain what I’ve learnt so far!

The best resource for NLA/Curve modifiers (and walk cycles using the OffBone) I’ve found is this german wiki page, translated roughly by yahoo babel fish;
http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=http://de.wikibooks.org/wiki/Blender_Dokumentation:_Offset_Bone_und_Deform_Modifier&lp=de_en&btnTrUrl=Translate

If the armature starts doing weird things when you apply the curve modifier to the NLA strip, click on the path and press ‘ctrl A’ and select ‘Scale & Rotation to ObData’. If that doesn’t work, do the same thing for the armature. I think this clears all the extra rotations & such so that there are no extra modifiers (maybe a pro can explain this better?)

If the armature walks the wrong way, in the buttons window go into the Object Tab (F7) and on the Anim Settings panel change the ‘Track’ setting. Default is Y, so if it’s going backwards change to -Y, e.t.c.

Also with the curve selected, go into the IPO curve modifier and select ‘path’ from the IPO type and delete the speed curve.

Hope that helps :slight_smile:

I do have a question of my own, though - I’ve made three animations, a start-walk, walkcycle, and stop-walk. I can get the three to run seamlessly when done without a curve modifier, just using the OffBone setting, but when I try to introduce a curve modifier (same curve to all three, correct length, no IPO speed curve) then it ‘glitches’ at the frame where one action changes to another.

I think it’s to do with the location of the armature centre at the beginning of each action, but I don’t know enough about that to fix it. Any help?

Hi hughbert,

I had the same problem once before, the glitches where one action changes over to another action in the nla editor. My problem was with the nla strips overlapping each other and the keying of the master bone. Let’s say your stop-walk action is from frame 1 to frame 11, make sure the nla strip ends at 11, and the walk cycle starts at frame 12. You cannot overlap actions in the nla editor that have the masterbone keyed and used with the curve deform modifier. If your stop-walk action ends at say frame 11.25 and you walkcycle starts at frame 12, you will get that glitch. You can manually enter starting and ending frames for strips in the nla editor, so if one action ends at frame 11.25, go in and change it to 11, set the next action to start at frame 12. This should solve your problem, if not, I would need to look at your file.

Also, I said this glitch occurs with two actions with keyed master bones while using the curve deform modifier. So you can still mix actions together in the nla editor, so long as only one of them have a keyed master bone. For example, a walkcycle can be mixed with say a waving action, or blinking of the eyes, or movement of the mouth, since those actions don’t require the master bone to be keyed. Only movements of the arm/hand or face need to be keyed.

Hope that helps
Randy

Hi Randy, thanks!

That’s sorted it - dead smooth start/walk/stop on a curve now :slight_smile:

Thanks for the help. The problem I had was caused by the speed IPO curve, and was fixed when I deleted it. However, now I have a new problem. When I apply an action that uses IK chains with a target, it behaves in confusing ways. When I used the action modifier on a walk cycle that uses IK, the character walked in sort of a squatting position. The torso was where it was supposed to be, but the feet were a bit higher than they were supposed to be. The action modifier worked well enough when I did it in FK (though this worked while only using the action modifier on the torso; it didn’t work when I used it on the feet), but I find FK to be more wobbly and the feet slip during a walk cycle instead of staying flat at the same point on the ground while taking a step. In addition, it would be a hassle to have to key the influence for the IK constraint for each action (because if I key a FK walk cycle’s IK constraint’s influence as 0, the influence would remain 0 until another action is called with a keyed influence value, so I’d have to make sure at least all subsequent actions where I want to use IK would be keyed as having an influence of 1).

About the action modifier not working well when I applied it to the feet as well as the torso: the feet sort of moved away from the body right before they were supposed to turn at a curve in the path. I think I will only need to make a character walking in curved paths on the ground, and not up or down a hill, and it looks like the primary use of putting action modifiers on the feet is to make the character go up and down hill. So I might not need to solve the problem of it not working when I apply the feet to the action modifier.

However, my main interest is getting the action modifier to work on actions that use IK.

4096,

First, let’s tackle the fk legs and walking. You described the feet slipping around a bit. How did you create your walkcycle, with the character walking in place or with him moving forward with each step? I find that creating a walkcycle with the character moving forward to be the best. If you create the walkcycle with the character standing still, then it’s very hard to convert to walking forward.

As for the feet not behaving correctly with the modifier applied to them, are the feet controlled by bones that are horizontal? I find that if you don’t use them on the feet when walking around say a corner, the feet seem to slip a bit, more noticable on sharp turns.

Now, for the IK legs, are you using the modifier on the feet? The only thing that I can think of that would cause what you mentioned is if the modifier is on the feet and after applying it to the feet, you changed the postion of the path vertically. Could you post both the FK & IK .blend files? I’m off work the next two days and can take a look at both of them and maybe figure out your problems.

Randy

I made the FK walkcycle with the character moving foreward, not while walking in place. The feet are controlled with vertical bones. I put the IK constraints on the feet and they are controlled with separate bones, and I use the IK target bones (and not the feet directly) in the action modifier.

Thanks for the offer to look at the blend file. I’ve attached the file for the FK action. I tried to include the IK action the same file but I was unable to get it to work. I’ll try to upload a separate file with the IK action later. Also, I called the bone ‘back4’ that is equivalent to mancandy’s torso bone.

Attachments

action_modifier_test_20090920.blend (406 KB)

Man, I gotta tell you, that is one messed up .blend First off, you have subsurf modifier for the mesh set to 3 on the levels field. The render levels is set to 2. So the subsurf has greater detail in the working windows than it has when rendered. At level 3, I found 24,000 vertices, (upper right hand of blender window, next to the version number) When reduced to level one I get only 1647 vertices. You only need that level when you are rendering, not while animating. It doesn’t have to look nice while animating, just as long as it does while rendering. Congrats, you slowed down my 2.7 ghz dual core system I just built!!!

The armature modifier has not been applied to the mesh. When I try to apply it, blender tells me there are shape keys and so it won’t apply it. It must be applied and parented to the mesh for this to work.

I will look at the file more, but I find several things wrong with it, you might need to back up a few steps in the development of this to correct problems…

Perhaps some with more expirence could help you out…
Randy

I’m sorry about the problems with the other blend file. I now have a separate file for the action modifier for the IK walk cycle, and this time I made sure to set the subsurf levels to 1, and I deleted the shape keys so that the armature can be applied. It looks like the problem I am having with the IK walk cycle is that when the action modifier is used, the feet do not touch the bones that are there IK targets. However, the feet do touch the IK targets when the action modifier is not used.

Attachments

action_modifier_test_20090921.blend (231 KB)

4096,

Sorry I took so long to get back at you on this. Yes, the 2nd file you posted was not as badly screwed up as the 1st one, but it’s still pretty messed up. Where did you get the rig for this character???

Alright, this is what I noticed as screwed up so far: You have the deform modifier on the torso, and both feet, which is fine, but you also had them on the knees, which is not needed. You also have two curves for paths, yea, sure only one of them is being used, but the second one being there is just sloppy. So I removed all the deform modifiers in the NLA editor, after I did that, I ‘right-arrow’ to advance the frame, and the character changed in it’s scale, became smaller, not sure why.

Go ahead and remove the modifiers and the curves, and try to get your character to walk, he’s still all screwed up. So it’s not the modifiers that’s your problem, it’s the rig and how the rig was used on the mesh that is your problem.

Here’s a short rundown of what I found wrong with the rig: There is no head bone, but two neck bones, so I assume neck2, the top most bone is his head bone. It’s not aligned with your characters mesh correctly, it starts where your characters shoulder are and ends below the base of the head. It has eye target bone parented to it. The eye target bones are below his chin, no up in front of the eyes. The ‘uparm’ bones are not position to start at the shoulder, the are located in the top of the chest. There are elbow targets that are way to close to then center of the character, and I can’t anywhere find them being used were they are being used (usually such bones are ‘targets’ for a constraint) Maybe that’s why the character walks with the elbow pivoting in the wrong way. Most people’s elbows bend backwards, you character walks with his eblow bending in front of him. And the knee targets are way to close for the knees (I didn’t even look to see if they were being used).

Whew, I am gonna stop there. I gotta say, and I say it alot, this tutorial I did was the best thing ever for me…

http://wiki.blender.org/index.php/Doc:Tutorials/Animation/BSoD/Character_Animation

Go thru the whole thing, i think you could learn alot,
Randy

Randy,

Thanks for the response. Actually, before I added the action modifiers, the walk cycle was working and the armature was more properly aligned with the mesh. I have no idea why, but the character was moving downward by about 0.4 to 0.45 units at certain times when I was putting the action modifiers on the character. (When I say it was moving downward, I do not mean during animation). I made another file with the action modifier on the IK walk cycle. This time character did not move downward by 0.4 units, but it is still walking in a squatting position and the feet do not touch the IK targets. I’ve attached files with and without the action modifier applied to it (humanoid_noshapekeys does not have the action modifier and action_modifier_test has the modifier).

Attachments

action_modifier_test_20090923.blend (321 KB)humanoid_noshapekeys_20090923.blend (318 KB)

Actually, I think I just found the solution to my problem. I changed the xyz scale values of the curve to the same scale as the armature and the walkcycle worked. Thanks for all your help Randy.

I do have one more question though. You wouldn’t happen to know if it is possible to set an offset bone and an action modifier from a python script? I couldn’t find any referneces to offset bones or action modifiers at http://www.blender.org/documentation/249PythonDoc/NLA.ActionStrip-class.html (except that the flag has a way to set single-axis cycling flags) and I also couldn’t find anything when I used the dir command from within a Blender python console.