Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

DUIK Bassel Walk Cycle Mover

Mentor ,
Oct 23, 2018 Oct 23, 2018

Hi there!

For everybody who uses DUIK Bassel walk cycle and don't want to move the character comp by hand as the character walks, here is the expression:

iniX = value[0];

myframe = timeToFrames(time);

skal = transform.scale[0]/100;

mycomp = thisLayer.source.name;

myTime = sourceTime(time);

for (n = 0; n <= myframe; n++){

    timeback = thisComp.frameDuration * n;

    step = comp(mycomp).layer("C | Walk Cycle").effect("Walk Cycle")("Step amplitude (cm)").valueAtTime(myTime - timeback);

    stepperframe = step / (comp(mycomp).layer("C | Walk Cycle").effect("Walk Cycle")("Cycle duration (f)") / 2);

    iniX += stepperframe;   

}

myX = iniX * skal;

[myX ,value[1]];

Apply it to the position of the character comp. The final structur should look like this:

character comp -> Position -> this Expression

     |

     |_ character layers, DUIK rig, controllers, walk cycle controller

The code is easy and straight forward, but works with keyframed "general motion" in the walk cycle controller, time shifted character comp, scaling in every dimension and every direction of walking.

Feel free to use, spread, edit.

Cheers,

Martin

TOPICS
Expressions
5.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 24, 2018 Oct 24, 2018

Interesting! It is kind of the inverse of what I did in iExpressions. In iExpressions you keyframe the characters position and the walk cycle walks accordingly. In your case, you keyframe the motion of the walk cycle and the character moves accordingly.

See also After Effects Character Animation Tutorial Series | mamoworld

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 24, 2018 Oct 24, 2018

Ha, funny! Two sides of the coin...

But both should be possible: walking on the spot as well as slipping, or moonwalking. So it's a good idea to not hard-connect the cycle with the position. Even if this is, what most people want, I prefer the have the option to create unrealistic comic-motion.

However, DUIK did not include (as far as I know) the function to move the character according to it's walk cycle at all, and if you really just want the character walk realistically, you have to start counting pixels and keyframe everything. That's when the expression comes in handy.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 24, 2018 Oct 24, 2018

Yes, doing it the iExpressions way is probably very tricky with the new DuiK walk cycles. Always good to have choices 🙂

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 21, 2018 Nov 21, 2018

Hi Martin

Thanks for sharing this out!

I actually used your expression in a project recently but I had so many rigged precomps that it was becoming impossible to work. It's obviously coming from the for loop so I just tweaked a little bit your code to help AE to calculate (especially when you have a 1000+ frames composition)

iniX = value[0]; 

skal = transform.scale[0]/100; 

mycomp = thisLayer.source.name; 

myTime = sourceTime(time);

myframe = timeToFrames(myTime); 

 

for (n = 0; n <= myframe; n++){

     if (thisLayer.active==0) break;     

     timeback = thisComp.frameDuration * n; 

     step = comp(mycomp).layer("C | Walk Cycle").effect("Walk Cycle")("Step amplitude (cm)").valueAtTime(myTime - timeback); 

     stepperframe = step / (comp(mycomp).layer("C | Walk Cycle").effect("Walk Cycle")("Cycle duration (f)") / 2); 

     iniX += stepperframe;     

 

myX = iniX * skal; 

[myX ,value[1]]; 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 22, 2018 Nov 22, 2018

Hi Flecoq,

that's cool man!

I wrote the code for one rig in a short comp, but soon noticed a huge performance drop when it comes to longer comps and more rigs. It's the for-loop - no doubt.

I thought of calculating the time from layers-in to current time-position and take this into multiplication with "step", instead of moving the rig frame-by-frame by tiny amounts. One must take care of a keyframed walkcycle - maybe with a if-loop, which switches between the already coded behavior and the described one. However, didn't find the time to write it yet.

I also noticed a strange motion-blur issue, where the mb stays on the character, after it's movement. This is also related to the expression, but I don't know in which way (since it's not logic to me).

I helped myself so far by using the code to adjust everything and after that, transferring it into keyframes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 22, 2018 Nov 22, 2018

An other way to help calculations would be to pause the loop when the general motion is equal to 0. I've been trying to do that but my javascript skill aren't good enough

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 22, 2018 Nov 22, 2018

This won't work, since you can't hold the last calculated value. Sadly...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 22, 2018 Nov 22, 2018

Oh ok, I thought maybe with a while loop we can achieve something!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 22, 2018 Nov 22, 2018

The only way to hold a value is to loop through the frames and calculating the same value over and over again... and this will decrease performance as the for-loop already does.

Tricky...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 15, 2021 Dec 15, 2021

Hey Martin (and Mathias... and anyone on this thread) !

 

Question; Is there a way to make the Duik walk cycle take longer steps?  All the experiements I'm doing, the characters are making these little , step, step steps .... I want the character to have more reach. To step out!  Any ideas?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 15, 2021 Dec 15, 2021

Hi Andrew,

there are a lot paramters to play around with in the DUIK walk cycle. If those don't bring you to your goal, it's best to create your individual walk cycle. You just need a handful of keyframes - it's not that hard. Find yourself a walk cycle drawing, if you aren't familiar with the poses. 

 

Since we are in this thread again, don't use the expression provided here. It was a foolish idea which will kill AEs performance. 

 

*Martin

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 15, 2021 Dec 15, 2021

Hey Martin... thanks for the reply!     Yes, I increased the walk speed, and that extends the length of the stride.  Good!  But it also causes "snapping" in the legs.

 

I'm trying to do it manually now.  Thanks again!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 16, 2021 Dec 16, 2021
LATEST

Yes, in fact the auto walker has it's limits. Still, if you need a character to just walk, this provides a fast way with okish quality to get it done.

 

When it matters, you better do it on your own. As always, as everywhere 😉

 

*Martin

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines