12 Replies Latest reply on Aug 26, 2011 12:52 AM by CarloNico

    Global Adjustments and Updating

    CarloNico Level 1

      I need to apply identical scale and opacity effects to multiple layers.

       

      The layers will contain different artwork but the opacity and scale effects are to be universal.

       

      However each layer will appear at a different position on the time line.

       

      The thing is, I need to adjust and fine tune the scale and opacity without having to go into each layer (maybe 50 layers) individually.

       

      I have looked at several strategies including 'saving animation preset'. But was unable to see how I could globally update the preset once applied.

       

      I have looked at parenting, nesting and expressions - but I'm unsure how to progress.

       

      Thanks for your time.

        • 1. Re: Global Adjustments and Updating
          Rick Gerard Adobe Community Professional & MVP

          If I'm understanding you correctly you want to have all of your layers have the same opacity. This is easy to do if you add a null to your project then rename the null controller, then add an expression slider to the null. Next you would lock the Effects Control Panel so that it will stay visible. Now you go to the first layer you want to control and add an expression to the opacity property by simply dragging the pickwhip to the effects slider.

           

          Now choose Edit>Copy expression only and then choose all of the other layers and paste.

           

          The value of the slider is now driving the opacity of every layer.

           

          If you want to have every layer fade in and out for a certian number of frames you can modify the expression to use time and the in and out points of the layer along with the opacity effects control slider. Let me know if that's what you want to do.

          • 2. Re: Global Adjustments and Updating
            CarloNico Level 1

            Thank you for being so kind and getting back to me.

             

            Before I study what you sugested, I'll just confirm the problem.

             

            Imagine you have 20+ layers, each layer has a different photo on it.

             

            Each layer is going to fade in, in the same way using scale and and opacity key frames.

             

            However this will happen one after the other.

             

            I want be able to globally update the the opacity and scale values.

             

            Maybe it is as simple as selecting all the layers and somehow doing it that way.

             

            The problem is, down the line, when the client says it's not working and I have to adjust each layer by hand.

             

            Thanks

            • 3. Re: Global Adjustments and Updating
              Rick Gerard Adobe Community Professional & MVP

              In that case you have to add the controller null, then add an Expression Control Sliders.

               

              You need a start opacity slider, and an end opacity slider, and a slider for the number of frames you want to use for the transition. Name the sliders by slimply clicking the slider, hitting return, and typing in the name.

               

              // define values;
              sVal = thisComp.layer("controller").effect("start opacity")("Slider");
              eVal = thisComp.layer("controller").effect("end opacity")("Slider");
              dur = thisComp.layer("controller").effect("n frames")("Slider") * thisComp.frameDuration;
              ip = thisLayer.inPoint;
              op = thisLayer.outPoint;
              
              
              // calculations;
              
              
              v = Math.min(
              linear(time, ip, ip + dur, sVal, eVal),
              linear(time, op - dur, op, eVal, sVal))
              
              

               

              You could do a similar thing with scale by adding an effects control slider to control null, but I'd approach the problem by making the layers 3D and adding a point control and a z position slider to the layer instead of to the controller null. You caan then tie the starting position to those values and set the end position of the layer by simply dragging the layer to it's final resting point. You'll get a better looking effect than using scale because scale doesn't really simulate a camera move or a zoom because it's linear. (see the help files on Exponential Scale) Here's the expression that I'd use:

               

              psx = value [0] + effect("starting xy position")("Point")[0];
              psy = value [1] + effect("starting xy position")("Point")[1];
              psz = position [2] + effect("starting z position")("Slider");
              sp = [psx, psy, psz];
              
              
              linear(time, inPoint, outPoint, sp, position)
              
              

               

               

               

               

              Again, make sure that you name the point control and the slider correctly. The way this works is that you set the end position of each layer, then you use the expression controls to set the starting position for each layer, then you add the opacity expression to each layer and sequence the layers.

               

              If you wanted all layers to start in the same position you could add these expression controls to the null and modify the path in the psx, y and z parameters by pointing to the controller null.

               

              Hope this helps.

              • 4. Re: Global Adjustments and Updating
                CarloNico Level 1

                Thanks I will study this. If I can do it, it will really move me forward. Thanks again.

                • 5. Re: Global Adjustments and Updating
                  CarloNico Level 1

                  "Now you go to the first layer you want to control and add an expression to the opacity property by simply dragging the pickwhip to the effects slider."

                   

                  I'm afraid I couldn't work this bit out.

                   

                  The pickwhip from,

                  the controller

                  or the layer,

                  to where?

                  The effects control panel with the slider.

                  Or to the Controller nul layer.

                  It didn't seem to go anywhere apart from the name of the layer.

                  I'm missing something.

                  Thanks

                  • 6. Re: Global Adjustments and Updating
                    CarloNico Level 1

                    Alt click.

                    Thanks.

                    • 7. Re: Global Adjustments and Updating
                      CarloNico Level 1

                      This is great.

                      I have got some layers controlled by three sliders on controller.

                      However, I not sure how to 'attach' the behaviour to each individual layer as they appear in the time line.

                      The effect just seems to happen at the begining of the comp.

                      When I move the layer later in time in the comp the effect seems 'left at the begining' not relative to the layer.

                      • 8. Re: Global Adjustments and Updating
                        Rick Gerard Adobe Community Professional & MVP

                        Here's a CS5 project that may get you started.

                         

                        The expressions can be simplified a great deal if you just want to animate opacity from 0 to 100 over a set number of frames. In that case all you have to do is to add this expression to the opacity value and type in the numbers you want to use. Then sequence the layers using the same overlap as the number of frames you've chosen for your duration. You won't have to add the controller null.

                         

                         

                        // define values;
                        sVal = 0;
                        eVal = 100;
                        dur = 25 * thisComp.frameDuration;
                        ip = thisLayer.inPoint;
                        op = thisLayer.outPoint;
                        
                        // calculations;
                        
                        v = Math.min(
                        linear(time, ip, ip + dur, sVal, eVal),
                        linear(time, op - dur, op, eVal, sVal))
                        
                        
                        1 person found this helpful
                        • 9. Re: Global Adjustments and Updating
                          CarloNico Level 1

                          Thanks for your time. I'm really grateful (the 3d layers seem more organic somehow.)

                          Anyway, I think this might be it.

                          Carlo

                          • 10. Re: Global Adjustments and Updating
                            CarloNico Level 1

                            One last question.

                             

                            I do want a linear scale effect applied to each layer.

                            I have been trying to write an expression to achieve this but have not got enough knowledge. I know it's quite simple.

                            The scale change has to be relative to the inpoint and outpoint of each layer.

                             

                            Thanks

                            • 11. Re: Global Adjustments and Updating
                              Rick Gerard Adobe Community Professional & MVP

                              If you want the use scale you just need to turn the result of the calculations into an array. In the opacity calculation the variable is defined as v.

                               

                              //Calculations

                               

                              v = Math.min(
                              linear(time, ip, ip + dur, sVal, eVal),
                              linear(time, op - dur, op, eVal, sVal))

                               

                               

                              There is only one property for opacity, but there are values for x, y and if the layer is 3D z for scale. These x, y and z values are held in an array which is set inside square brackets separated by commas.

                               

                              To make the opacity expression work for a layer with x, y and z values just fill the array with the value you want. In this case it's the variable "v" from the calculation.

                               

                              If it's a 2D layer then the last line of the expression would be written like this:

                               

                              [v, v]

                               

                              if it's a  3D layer you could write the line like this:

                               

                              [val, val, 100]

                               

                              Make sure that you put a semicolon after the calculation to start a new line of code.

                               

                              Now that you've got that let's take a closer look at the calculation. We wanted the opacity to change from the initial value of sVal set by the start opacity slider to the value of the eVal set by the end opacity slider for over the number of frames set by the n frames slider. We changed time to frames with the dur calculation by dividing the number of frames by the frame duration of the coposition. I would imagine that you want the scale of the layer to change from the sVal to the eVal for over the total length of the clip. It probably would look better if that value were not linear. That means you would want to re-write the v calculation to this:

                               

                               

                              v = ease(time, ip, op, sVal, eVal);
                              [v, v, 100]

                               

                               

                              This should be fairly easy to understand. We're calculating the value over time between the in point an the out point using the starting value and the ending value. The rate of change is now easing between the starting and ending values instead of being linear. I set the Z value in the array to 100 instead of using the calculated value of v because if the anchor point has been changed in Z then changing scale will change the z position.

                               

                              If your layer is 2D then you don't add the last value in the array. This also brings up another option. If you wanted to scale the layer only in y then you could write the last line like this:

                               

                              [100, v]

                               

                              Now you have a layer that grows in height. You cold also bring the dur value back into the calculation to set the number of frames it takes to go from sVal to eVal or set the number of frames before the out point where the scaling stops.

                               

                              Let me know if you have any other questions.

                              • 12. Re: Global Adjustments and Updating
                                CarloNico Level 1

                                Hi Rick,

                                My undestanding of Javascript is quite basic so is my undestanding of how expressions interact in AE, however I would say I am 80% there.

                                Unfortunatly I can't seem to get the the scale to work. Although I understood 80% of what you suggested.

                                 

                                One other question. What is the 'check to set up' for?