FORUMS: list search recent posts

luma to drive animation of multiple comps

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
andy acourt
luma to drive animation of multiple comps
on May 29, 2012 at 12:19:45 pm

Hi, I trying to animate the scale of an array of comps from a background fractal map. So for instance if the luma of a the section of fractal behind a particular comp was 100% white that comp's scale would be 100%

Thanks in advance


Return to posts index

Wim Bruyninckx
Re: luma to drive animation of multiple comps
on May 29, 2012 at 1:07:15 pm

Hi,

not sure of this will help you but;

I would suggest to use the nifty expression sampleImage() in the scale property layer
of each comp you want to scale in your array :

the expression would be:
100*[thisComp.layer("GreyscaleMap").sampleImage(position)[0],thisComp.layer("GreyscaleMap").sampleImage(position)[0]]

position = the position of your current comp you want to scale
where GreyscaleMap = your fractal map...
multiply it by 100, because sampleimage returns a value between 0 and 1.

Kind Regards

Wim

graphic designer / illustrator

http://www.flickr.com/photos/wixwix/
http://www.wimbr.be


Return to posts index

Dan Ebberts
Re: luma to drive animation of multiple comps
on May 29, 2012 at 1:21:31 pm

It would probably be like this:

target = thisComp.layer("background");
rgba = target.sampleImage(target.fromComp(toComp(anchorPoint)), [.5,.5], true, time);
luma = rgbToHsl(rgba)[2];
[luma,luma]*100


Note that this is set up for a 1-pixel sample--you might want a larger area, depending on your setup.

Dan



Return to posts index


andy acourt
Re: luma to drive animation of multiple comps
on May 29, 2012 at 4:24:03 pm

thanks for this, unfortunately I cant get it to work and I'm sure its me.
the fractal is on layer 1 and called "GreyscaleMap"
the comp I want to scale is on layer 2 and called "comp"
I've applied the script to scale property of the "comp" layer

and thats where my understanding falls apart - any more help would be greatly appreciated.


thanks


Return to posts index

Wim Bruyninckx
Re: luma to drive animation of multiple comps
on May 29, 2012 at 6:21:44 pm

make sure you precomposed the fractal layer, otherwise it won't work


Return to posts index

andy acourt
Re: luma to drive animation of multiple comps
on May 29, 2012 at 9:11:34 pm

thanks for both of your help, especially Dan, it worked in the end. The problem was the fractal map had 3D turned on. As soon as I turned it off the script worked.


Return to posts index

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