11 Replies Latest reply on Aug 4, 2008 9:17 PM by (didgi)

    Gradient map for shatter

    Level 1
      Hi

      I've ceated this shatter map with After effects.
      http://img388.imageshack.us/img388/2644/bild2yr8.png
      It's made out of 256 solids via Scripts and expressions.

      Now,how can i create a gradient map so i have got control over all pieces .

      I'd like to reveal them in a specific order.First row reveals from left to right then second row from right to left and so on...one row after the other.

      Any expressions to give them a slight color change?
        • 1. Re: Gradient map for shatter
          bogiesan-gyyClL Level 3
          A Shatter Map is different from the control layer.

          Creating a control map shouldn't be too hard but you will need at least 256 shades of gray. Difficult. You don't need them to be hard edged like your pieces, you just need 16 different ramps, 1/16th frame high.

          The guys who make Pixelan SpiceRack may have exactly what you need, excellent resource for any and all compound effects in AE. Google 'em.

          bogiesan
          • 2. Re: Gradient map for shatter
            Level 1
            hi

            Thx David for your reply.
            I use this opacity expression on each layer

            num_layers=256;
            max_opac=100;

            max_opac-index*(max_opac/num_layers)

            it gives me a perfect gradient map,first layer pure white+last layer black.
            On each row opacity decreases from left to right.(not what i want)
            how do i need to change this expression so that every second row decreases its opacity values from right to left?i've got 16 rows.
            Thx
            • 3. Re: Gradient map for shatter
              Mylenium Most Valuable Participant
              You could simply invert the values? "100-value" should do the trick and if you are building the grid based on expressions, so you'd have a unique ID for each row, anyways, so you'd only sort them out using yet another modulus (%2) to determine odd or even...

              Mylenium
              • 4. Re: Gradient map for shatter
                Level 1
                Hi Mylenium

                b You could simply invert the values? "100-value" should do the trick"

                Unfotunately,it does not work.This way it changes value from i.e 96.6% to 0.4%.

                b using yet another modulus (%2) to determine odd or even... "

                Basically, i use a nabscript to split one layer into 16rows and 16 columns(256 layers)
                First row is layer 1-16.
                second row 17-32 and so on

                layer 16's opacity value is 93.8 (calculated via above expression)-first row
                layer 17's opacity value is 93.4 at the moment (not what i want)

                layer 32 should have now 93.4% opacity,layer 31 should have 93.0% opacity etc.

                I need to reverse my expression somehow.any ideas?
                • 5. Re: Gradient map for shatter
                  Mylenium Most Valuable Participant
                  If a simple invert does not work, then use a proper remap based on the layer index:

                  linear(index,1,256,100,0)

                  By limiting the index ranges you could also easily manage to take care of the odd/even thing without further ado, you just need to take care of the opacity values as well, of course. I'm not familiar with nab's script and would have to look it up, but a uniform grid can be defined with something like this:

                  pRow=Math.ceil(index/numCols);
                  pCol=Math.ceil(index-(pRow-1)/numRows);

                  If you now take pRow, you can easily determine if a Row is odd or even with a modulus:

                  if(pRow % 2 == 0){...do this... } //even row
                  else {...do that...} //odd row

                  Hope this gives you some pointers.

                  Mylenium
                  • 6. Re: Gradient map for shatter
                    Level 1
                    If it were me I'd make a custom brush in Illustrator using a black to white gradient expanded and turned into an art brush. Then I'd turn on the grid and use the pen tool to go back and forth using the pattern that I wanted, then I'd export a png file to use as the map. It would look like this and it took less than 2 minutes.



                    Enjoy
                    • 7. Re: Gradient map for shatter
                      Andrew Yoole MVP & Adobe Community Professional
                      Rick, if you have a moment would you mind breaking down the AI process a little more? I'm intrigued by your description but can't quite get to grips with your process.
                      • 8. Re: Gradient map for shatter
                        Level 1
                        Hi

                        i Rick, if you have a moment would you mind breaking down the AI process a little more?

                        I would be interested in this as well.

                        Mylenium,thank you very much for your patient.

                        you're on the right track but the linear function doesn't do the trick either.
                        What i have so far

                        pRow=Math.ceil(index/16);
                        pCol=Math.ceil(index-(pRow-1)/16);
                        if(pRow % 2 == 0){
                        linear(index,1,256,100,0)//even row
                        }else {
                        100-index*(100/256) //odd row
                        }
                        • 9. Re: Gradient map for shatter
                          Mylenium Most Valuable Participant
                          Position:

                          //===begin expression===

                          //grid size

                          gSize=16;

                          //grid spacing

                          gSpace=30;

                          //rows and columns

                          pRow=Math.ceil(index/gSize);
                          pCol=Math.ceil(index-(pRow-1)/gSize);

                          //positions

                          X=pCol*gSpace-gSpace*gSize*(pRow-1);
                          Y=pRow*gSpace;

                          [X,Y]

                          //===end expression===

                          Opacity:

                          //===begin expression===

                          //grid size

                          gSize=16;

                          //rows and columns

                          pRow=Math.ceil(index/gSize);
                          pCol=Math.ceil(index-(pRow-1)/gSize);

                          iStart=pRow*gSize-(gSize-1);
                          iEnd=pRow*gSize;

                          oStart=100/Math.pow(gSize,2)*(pRow-1)*gSize;
                          oEnd=100/Math.pow(gSize,2)*pRow*gSize;

                          if(pRow % 2 == 0)
                          {
                          mOpa = linear(index,iStart,iEnd,oStart,oEnd) //even row
                          }
                          else
                          {
                          mOpa = linear(index,iStart,iEnd,oEnd,oStart) //odd row
                          } ;

                          [mOpa]

                          //===end expression===

                          Use this in a pre-comp with white solids on top of a black solid to generate a b/w gradient.

                          Mylenium
                          • 10. Re: Gradient map for shatter
                            bogiesan-gyyClL Level 3
                            I bow to the collected wisdom of our expressions wonks.
                            Expressions make my head hurt and Illustrator, fortantely for me, lies in the same basket as Photoshop and Powerpoint and Xcel: never used distratctions.
                            That's why I own Pixelan Speces.

                            bogiesam
                            • 11. Re: Gradient map for shatter
                              Level 1
                              thank you Mylenium