Quantcast
Channel: Adobe Community : Popular Discussions - After Effects Expressions
Viewing all articles
Browse latest Browse all 47983

Help with 3D Layer Position Expression

$
0
0

Hi All,

 

I do hope some one can help me – I have been looking and trying to solve this expression problem I have run in to - I only have limited expression knowledge.

 

I need to move a layer in 3D space, only the Z axis: from lets say -50 to 0 (based on the start of the layer) and then stop and then move 0 to 50 (again based on the end of the layer)

 

I have multiple layers of different lengths that I want to add this to…then just adjust the layer to the time to be displayed on the screen.

 

I have used some code from Harry Frank, his AUTO FADE code (which is a god sent) and have tried to make the above movement possible, with sections of the code, its close but no cigar – the code:

 

//Auto Move Z

x = 0;

y = 0;

z = 50;

transition = 20;       // transition time in frames

if (marker.numKeys<2){

tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds

linear(time, inPoint, inPoint + tSecs, thisLayer.position + [x,y,z],0) - linear(time, outPoint - tSecs, outPoint, thisLayer.position +  [x,y,z],0)

}else{

linear(time, inPoint, marker.key(1).time, thisLayer.position + [x,y,z],0) - linear(time, marker.key(2).time, thisLayer.position + [x,y,z],0)

}

 

It is moving but it’s moving on all axis and the OUT is moving backwards instead for forwards. Plus is has moved from the centre position.

 

Any help would be most appreciated, thank you in advance for any help!

 

Cheers Breon

 

Message was edited by: breonsnow - spelling


Viewing all articles
Browse latest Browse all 47983

Trending Articles