Heya gang! I’m playing with Locomotion now, and find myself going back to older tutorials and live streams. I’m doing a pretty long walk for a few creatures, managing footsteps over a long frame-range.
Got a few feature questions:
Can we apply a Preset to an existing Plan? (Say, at frame 1001 I start with the Walk Preset, then at frame 1062 I’d like to transition to the Gallop Preset, and so on)
Is there a way for me to marquee select, copy, and paste existing timings?
I’m investigating how the attributes are set under the hood, maybe I can leverage that into buttons like “ripple timing by x frames”, or “paste once gallop cycle”, etc…
Presets are very limited, but the upside is that the interface for authoring and manipulating these yourself is fairly straightforward.
Here’s a primer on it.
Ensure feet are down at the start and end frames, you wouldn’t want him to start in the air, or end in the air
Give each step at least 3 frames; anything shorter and he’ll more or less attempt to jump on each step
Find a more suitable authoring format
Here’s what the default walk preset looks like.
from locomotion.vendor import cmdx
# Base alternating patterns
right = "000000000000001111111111000000000011111111110000000000111111111100000"
left = "000001111111111000000000011111111110000000000111111111100000000000000"
patterns = (right, left)
feet = cmdx.ls(type="rdFoot")
with cmdx.DagModifier() as mod:
for i, foot in enumerate(feet):
# Clear previous values
mod.set_attr(foot["stepSequence"], [0] * foot["stepSequence"].count())
# Set new values
sequence = patterns[i % 2]
sequence = list(int(s) for s in sequence) # to integers
mod.set_attr(foot["stepSequence"], sequence)
The actual implementation (locomotion/commands.py:_preset_stepsequence()) does a bit more to simplify the syntax and scales the sequence to fit the current frame range. All of which you can find in that Python module.
Flip some of the 1’s and 0’s to produce different locomotions programmatically. You’ll find the UI updates automatically as you do, and you can even enable “Auto Update” to run the sim on each update as you tweak.