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

Connecting background to walk cycle made in Duik

New Here ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

I have created a walk cycle with Duik Bassel 2. My character is going to walk on the same position throughout the animation with a sliding background behind it. The character is going to stop walking at a few places so I need the background to stop moving as well. I could just keyframe the position of the background to stop at the same time as my character but I was wondering if there is a smarter way to animate the background to the walk cycle. Is there a way to write an expression that connects the background position to the general motion of my walk cycle?

TOPICS
Expressions , Scripting

Views

1.3K

Translate

Translate

Report

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
LEGEND ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

And how often do you need it? Are you asking to create a convoluted expression for what amounts to a handful of keyframes otherwise? Of course there are ways to calculate all this, but it may in fact not even look good, so if you can and this isn't some long 30 minute animation or a template for recurring use just do it by hand.

 

Mylenium

Votes

Translate

Translate

Report

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 ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

I did such a think once and it was horrible!

 

My solution was a recursive function, which calculates the "steps" and moves the character accordingly. Due to expression limits, the calculation had has to take place in every frame for all previous frames. The outcome did work, but painfully slowed down AE. I finally converted the expression to keys to get the values and drop the expression jsut to be able to work again.

 

A better solution, which I never test, would be to map the character walking against "time". So you say one step is 30px (I think you can read out those values from DUIK) and the character is making 0.5 steps per second and is walking for 5 seconds, so the travel distance is step * steps/s * time. You can meassure time distance between two keyframes or markers to get the time-spans... it should be doable, but as Mylenium said, putting some keyframes on the background is more straight forward and way faster.

 

*Martin

Votes

Translate

Translate

Report

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 ,
May 14, 2020 May 14, 2020

Copy link to clipboard

Copied

The iExpressions Walk Cycle offers a clean solution for that.

It also works with DuiK.

The concept is essentially the opposite of DuiKs walk cycle. In DuiK, you are creating a walking loop and then it is up to you to move either the character or the background accordingly. With the iExpression, you just keyframe the position of the character and/or the background and the expression figures our how the legs need to be moved to fit.

Here is a general overview:

 

And here is an example how to combine this with DuiK

 

iExpressions is available at aescripts and the walk cycle is just one of more than 100 expressions included in it: https://aescripts.com/iexpressions/

 

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

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
New Here ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

LATEST

Hi. Here's one way to link background position to the walk cycle in DUIK:

 

If you open up the "Walk Cycle" layer and scroll down to the bottom of all the effects and expressions, you'll find "Computation". Open that up and you'll find "Cycle duration (s)" and "Step amplitude (cm)"

 

You can grab these and add them to an expression in the "position" value of your background layer and it'll look something like this:

 

a=thisComp.layer("C | Walk Cycle").effect("Walk Cycle")("Step amplitude (cm)")*thisComp.layer("C | Walk Cycle").effect("Walk Cycle")("Cycle duration (s)")*time;
[transform.position[0]-a,transform.position[1]]

 

Basically, you're multiplying the "Step amplitude" by the "Cycle duration" by "time" and adding this figure to the horizontal value of your background layer.

 

 

Another way would be to add the "Motion tile" effect to your background layer and a similar effect to the "Tile Center" value like this:

 

a=thisComp.layer("C | Walk Cycle").effect("Walk Cycle")("Step amplitude (cm)")*thisComp.layer("C | Walk Cycle").effect("Walk Cycle")("Cycle duration (s)")*time;

[effect("Motion Tile")("Tile Center")[0]-a,effect("Motion Tile")("Tile Center")[1]]

 

Hope that helps!

Votes

Translate

Translate

Report

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