Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How do i affect an enormous number of objects’ opacities

  • How do i affect an enormous number of objects’ opacities

    Posted by Doug Myers on July 1, 2016 at 4:27 pm

    I’m working on a project where I need to have, due to the size of the composition, thousands of small squares with strokes vary in opacity over time. I have been attempting to use expressions to map the value of a fractal noise control layer to the opacity value of the squares using point sampling, which after struggling with for a while i got to vaguely work. The computer I have to use is not very powerful at all so I have yet to see the opacity change dynamically. I know that I can make lots of copies of a square using repeat, but I’m afraid that the squares will only vary according to the value behind the original square, making all the squares change at the same rate, not vary individually, making rolling patches of opaque squares.

    I suppose wiggle could achieve a similar look but i really am going for those roving bands of squares that fade. so does applying a mosaic to the fractal I’ve made.

    Any suggestions?

    sourceLayer=thisComp.Layer("Control Layer");
    sampleSize=[1,1];
    samplePoint=transform.position;
    color=sourceLayer.sampleImage(sampleSize,SamplePoint);
    x=color[0]*100
    [x]

    Dan Ebberts replied 10 years, 2 months ago 3 Members · 4 Replies
  • 4 Replies
  • Kalleheikki Kannisto

    July 2, 2016 at 6:49 am

    Are those squares in a grid or are they floating around freely?

    If they’re in a grid, the Mosaic effect used as a track matte would do it. If they’re not, your method seems fine. (I wouldn’t expect to see it in real time without using RAM preview.)

    An individual wiggle for each square would be quite random.

  • Dan Ebberts

    July 2, 2016 at 11:43 pm

    I’m not sure, but this might be the perfect application for the noise() function. Adjust the first two lines to get the spread and speed you want:

    xyCompress = 200;
    timeCompress = 1;
    minOpacity = 10;
    range = 90;
    n = noise([position[0]/xyCompress,position[1]/xyCompress,time/timeCompress]);
    minOpacity + range*(1+n)/2

    Dan

  • Doug Myers

    July 3, 2016 at 5:22 am

    so applying this code to a single shape layer with a repeater should make it so every repeated square changes individually right?

  • Dan Ebberts

    July 3, 2016 at 6:33 am

    No, it would be absolutely useless for that I’m afraid. They would need to be separate layers.

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy