# Another project: a walker script!

• I was going to write a captioning script, but I suddenly realized we can build a rather straightforward walker script in exactly the same way that one builds a stepping stone path in a garden (or those old mats with several numbered steps to learn a dance):

(a) Script: Add Steps to Current Figure

This creates a control panel on the ground, then adds 10 arrows on the ground and parents them to the control panel; or just adds 10 additional arrows on the ground and parents them the control. The cubes are named Step1, Step2, Step3, Step4, etc... It also enables IK for the right and left feet, and sets linear interpolation for xyzTran and xyzRotation on right and left feet, and also linear interpolation for xyzTran for hip.

Now the user moves Step1, Step2... on the floor as he/she sees fit, and rotates them on X/Y/Z axis as he/she sees fit make the feet take those rotations; that creates a walking path just like a stepping stones path.

Now say that user wants to move from starting position at frame 10 to end position at frame 110 in 10 steps (steps 9/10 are the end position). He sets the toon manually on the start position at frames 10, and sets the arrows for Step1 to Step 10 in the positions he wants.

Then control panel has one parameter called "State", values 1, 2, 3, 4, 5. Value 1 = don't move; 2 = forces left foot to start moving to next step; 3 = forces right foot to start moving to next step; 4 = alternate feet moving to next step. In this scenario value 2 in frames 10 (to start walking with left foot), value 4 in frames 11-110.

Then control panel has one parameter called "State", values 1, 2, 3, 4, 5. Value 1 = don't move; 2 = forces left foot to start moving to next step; 3 = forces right foot to start moving to next step; 4 = alternate feet moving to next step. In this scenario value 2 in frames 10 (to start walking with left foot), value 4 in frames 11-110.

Next parameter is "Force Next Step"; should be 0 everywhere for normal walking to step 1, 2, 3, etc..., but can be set momentarily to any value 1 or above to force the walker to go to a particular step. The purpose is for repeated stepping like in a dance.

Next parameter is "Contact"; this is how many frames the feet stay in contact with the ground, in each step; for regular walking this is 10, because one foot is always in contact with the ground, but for running this can be set to say 3 for a short kick on the ground for 30% of the time on the step, and then 70% of the time in the air (notice the opposite foot will be in the air, and that gives the movement of running).

Next parameters are "Start Frame" and "End Frame". This tells the frames that are under control of the script.

(b) Script: Walk

This is actually simple. It creates a bunch of master parameters in the control with Add operation for xyzTran and xyzRot for both feet, and xyzTran for the hip. It sets the values of these master parameters as 0 everywhere outside the Start and End Frames.

Within the Start/End Frames it will calculate which foot is moving and which Step it is moving to, and then set the xyzTran and xyzRot for that foot to xyzTran and xyzRot of that step (after some jabberwocking with local coordinate transformations), and then set the xyzTran of the hip to be midway between the xyzTran of the left foot and right foot (to keep balance). It will then just repeat a simple algorithm (assuming left foot moves first):

For Contact frames, the left foot is moving forward, and right is frozen
For (Stride-Contact) frames, left foot is moving forward, and right is moving backward
For Contact frames, the left foot is frozen, and right is moving forward
For (Stride-Contact) frames, the left foot is moving backward, and right foot is moving forward

The "delta" of the forward movement is of course the distance to next step, while the "delta" of the backward movement will have to be some factor of that.

That's it; because this is based on master parameters (like the Oscillator The Script), walking will not create any keyframes on the actual figure. The user will have to set hip rotations himself, as one cannot predict hip rotations in dance, and outside the Start/End frame the user can set whatever attitude he wants for the feet.

I think this might be a useful structure for a variety of IK-based actions, like walking with alternating steps, walking with repeated single foot moves (like feeting the way ahead), running and dancing. Of course the user will have to do the fine tuning of the hip, but at least the feet will be positioned.

Whatcha guys think?

• I have literally done the red (left) and green (right) cubes thing below the ground plane as stepping stones for a walk animation, so I see where you're coming from immediately. It completely relies, of course, on IK, and I always had issues with (as @erogenesis has noted in his own explorations) the IK requirements for joint limits that one might normally impose (like zero side-side on shin actors, and even zero twist on the shins, as with some older figures, shin twist distorted the knees, while foot twists distributed the twist over the whole shin). That said, however, I think the script idea definitely shows promise.

Perhaps particular walk styles could be parameterised in the same way that the Walk Designer does, but dealing with the control prop (need to find a better word than panel, as that has too many associations with macOS features. Maybe "control mat"?) and the step prop animation sequences.

I wonder if it would be possible to integrate with the walk designer, subsequently...

The other thing to think about is the new 3D-path feature of Poser 11.1, and whether that has any bearing on, or scope for integration with the script.

Would your state scheme be amenable to hopping (where both feet move forward together and leave the ground between contacts) or skipping (somewhat a blend of walking and hopping)?

Could it be expanded for quadrupeds? Centipedes? Millipedes? Even the ground contact points of snakes' undulations bear some relation to... [No, forget that last one ;-)]