ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

expression for sliding feet problem

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Spiridon Mekas
expression for sliding feet problem
on Jan 19, 2015 at 4:57:26 pm

Hello

I posted earlier in the after effects forum about trying to automate the task of adjusting and matching the movement of an animated character and its background to avoid "sliding feet" problem and have been advised to try and ask here.

Here is an example of what i'm talking about:

I have a character in side view walking. He is centered in the shot and the background is panning. When i animate a pan on the background the feet of the character appear to be sliding because they are not moving in the same speed/increments as the bg. I have to then adjust by manualy adjusting the bg move by adding more position points.

This is time consuming and a pain in the a--.


I'm compositing a lot of shots for an animation film and regularly have the sliding feet situation that has to be taken care of manually since i don't know how to write expressions.

Is there a way to automate this with expressions?

here is my original post in the AE forum:

https://forums.creativecow.net/thread/2/1059051#1059051

Many thanks for any help you can provide on this!


Return to posts index

Fahd Chishty
Re: expression for sliding feet problem
on Jan 20, 2015 at 9:29:24 pm
Last Edited By Fahd Chishty on Jan 20, 2015 at 9:37:23 pm

Provided that you are using a null object named "Foot Controller" and you want the floor to move back only when that null moves back, the following expression may help you.
Put it in the position of your floor.

temp = thisComp.layer("Foot_Controller").transform.position[0];
d=thisComp.frameDuration;
org=transform.position[1];
orgx=transform.position[0];
x=thisComp.layer("Foot_Controller").transform.position.valueAtTime(time-d)[0];

if(temp&lt;=x)
{
[temp, org];
}
else
{
[orgx,org];
}


--
Fahd Chishty
Motion Design Artist
MotionCue


Return to posts index

Spiridon Mekas
Re: expression for sliding feet problem
on Jan 21, 2015 at 3:55:29 am

thank you Fahd!

Ae is giving me an error report in line 1 of the script though.

I'll look into it, given that i'm a completely ignorant in anything concerning scripting it's probably me doing something wrong..


Thanks!


Return to posts index


Fahd Chishty
Re: expression for sliding feet problem
on Jan 21, 2015 at 5:23:10 am

It may be giving you error because your Null object has a different name. If that is the case then replace "Foot_Controller" with the name your own Null object.


Or you can remove this statement "thisComp.layer("Foot_Controller").transform.position[0]" and pickwhip the X position of your controller

--
Fahd Chishty
Motion Design Artist
MotionCue


Return to posts index

Spiridon Mekas
Re: expression for sliding feet problem
on Jan 21, 2015 at 5:34:36 am

That was it, thanks for replying Fahd.

There is another problem though, related to my ignorance, of course. I didn't take into account the fact that there is the other leg, and both legs go in cycle meaning that the foot first goes in one direction(horizontally) and then goes backwards(while the other moves forward) to complete a whole step cycle. The background goes backwards following the null of the first foot but then comes back as well.

I cannot imagine a workaround for this, guess i'll have to do it the old pedestrian way, keyframing it all the way.

Thanks again!


Return to posts index

Fahd Chishty
Re: expression for sliding feet problem
on Jan 21, 2015 at 5:49:06 am

Actually when I was working on your problem last night, I thought of that issue too. I will work on it tonight again and then post the modified code.

--
Fahd Chishty
Motion Design Artist
MotionCue


Return to posts index


Spiridon Mekas
Re: expression for sliding feet problem
on Jan 21, 2015 at 6:01:49 am

Thank you!!

If it is any help, both feet have exact same motion. They are basically the same foot, one traced over the other just redrawn to appear as left and right foot and.

Here is one of the walks i animated if you could use the reference:




Many thanks!


Return to posts index

Fahd Chishty
Re: expression for sliding feet problem
on Jan 21, 2015 at 8:57:59 am

Do they both use the same Null or are there separate Nulls for both of them each?

--
Fahd Chishty
Motion Design Artist
MotionCue


Return to posts index

Spiridon Mekas
Re: expression for sliding feet problem
on Jan 21, 2015 at 9:03:19 am

So far i just did one null and i did'nt know how to set the background to follow two null objects. And also the null object could just follow the foot horizontally, which is the only relevant movement for the background.


Return to posts index


Spiridon Mekas
Re: expression for sliding feet problem
on Jan 21, 2015 at 9:21:16 am

what i do is manually keyframe the null following the left foot, from the first frame until it goes back, just before it lifts and starts going backwards, then i thought i could just copy the keyframes for any duration of the shot that is necessary. But the problem is that the movement is then delegated to the other leg whose position is exactly on the first keyframe.


Return to posts index

Fahd Chishty
Re: expression for sliding feet problem
on Jan 21, 2015 at 4:13:18 pm

Dude! I have spent a lot of time on your problem, trying to solve it by expressions, but since After effects expressions have no way of storing a value, the floor jumps back to initial position once it has gone back with the foot.
I would suggest that you stick with the manual keyframes as they are easier to manipulate. Keyframe your floor to move back as each foot moves back.

In terms of expression, maybe Dan Ebberts can help. I raise my hands in defeat.

--
Fahd Chishty
Motion Design Artist
MotionCue


Return to posts index

Spiridon Mekas
Re: expression for sliding feet problem
on Jan 21, 2015 at 4:47:27 pm

I'm sorry to make you sweat over this, man, and grateful too! Thank you for this, nevermind if it worked or not.

Seriously, thanks a lot

I'll stick to manual labour and animate the backgrounds first next time:)


Cheers!



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]