Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

 
atropper
Topic Author
Posts: 1
Joined: Thu May 14, 2009 11:10 am

Cam-Distance

Tue Oct 04, 2011 2:46 am

Hi there,
Im using this script on a psd file i imported:

cam = this_comp.active_camera;
distance = length(sub(position , cam.position));
s = distance / cam.zoom;
mul(scale, s)

it should maintain the layer size in the comp no matter where i put it in z position. Not working for me: should i apply it to the layer position or scale property?

Anyone who knows that script can give me some pointers?

thanks
 
kobyg
Posts: 128
Joined: Fri Dec 07, 2007 10:11 am

Re: Cam-Distance

Fri Oct 14, 2011 12:04 pm

Hi atropper,
I hope this is still relevant for you...

This expression works fine for me!
You should give this expression to the Scale propery.

Make also sure you have:
1. a camera in the comp
2. your layer (the one you've given this expression to) is a 3D layer.
4. you are viewing the comp through the Active Camera (and not tny Custom View or Front camera)

Koby

Who is online

Users browsing this forum: No registered users and 3 guests