7 Replies Latest reply on Jun 10, 2016 8:37 AM by Gutter-Fish

    Looking for a script or plug-in

    Gutter-Fish Level 4

      Greetings from the reach,

       

      I am in search of a script or plug that will can slice a layer (even if it only works on a shape or a solid) and slice it up into non uniform shapes or masks.

      I have looked around and found a couple of things but nothing that creates non-uniform shapes.  Think like a randomized shatter effect, except the script would create non-uniform shapes or masks out of the initial shape or solid.  I hope that made sense. 

       

      \Thanks,

       

      Paul

        • 1. Re: Looking for a script or plug-in
          Mylenium Most Valuable Participant

          I hope that made sense.

          For the most part no, since arbitrary shapes cannot always be fitted seamlessly to begin with. Still, not all is lost. Using the shatter effect you can always use custom shatter maps. Since this is based on color assignments for the individual fragments, you would build it in a pre-comp, anyway. Then you can use any sort of displacement effect do deform the pattern you created to make it less regular. Similar techniques could be used with the Displacment Map effec, Card Dance and so on, but it realyl depends on what specific shapes you want to use.

           

          Mylenium

          • 2. Re: Looking for a script or plug-in
            Gutter-Fish Level 4

             

            For the most part no, since arbitrary shapes cannot always be fitted seamlessly to begin with.

            True.  But a "true" shatter is not really what I'm after, I just want to "cut it up" similar to what a shatter would do but the ultimate goal is to have separate masks or shapes.   For example: If I had a solid the size of my comp and I drew a little non-symmetrical mask with 3 verts.  If I then duplicated that mask and dragged one of the verts to a different location within a certain defined range of x&y from it's original location, I would then have two masks that "shared a side" so to speak. That is to say they would butt up against each other perfectly.

            If I repeated this say 40 times I could eventually have 40 non-symmetrical masks that fit together perfectly & covered the entire solid.

             

            I could probably pull off a script like this in Maya using MEL but that is the only language I'm comfortable with.  All I'd have to do is create the first mask (poly) then the script would duplicate it> randomly pick one of the three (or more) verts, move it to some other point in 2D space within a defined range from it's origin that is not already occupied by a previous mask(face).  That seems like it....then just loop through it until some terminating condition is met, maybe a number or when it can no longer find unoccupied space.

             

            In case you're wondering: The reason I want this is because I just purchased the Newton2 plug-in by MotionBoutique and it requires separate masks to apply it's physics.   So I guess technically I AM trying to go for a proper shatter effect except the goal is have the shattered peices behave in a physically correct manner via the Newton plug-in.

             

            actually it would be a little more complicated as I think about it because every other iteration the mask would have to share two sides rather than one...or something like that.  I'm sure there's something I'm overlooking.

            Appreciate your time.

            • 3. Re: Looking for a script or plug-in
              Mylenium Most Valuable Participant

              I get your drift, so essentially you're going for a triangulation with random point distribution. Would be perfectly doable with just effects, but as it is, the wheels fall off since you need masks. Unless you were to write a script yourself, there is no way to generate those shapes in the first place. In a 3D program you would quite likely not do any fitting at all. You'd simply subdivide the contours of whatever shape you have and move the points with edge slide, then do a triangulation. Creative use of beveling and additional subdivisions as well as merging polys would then allow to create a nice look. Finally you would simply unweld the vertices. A similar approach would probably work best in an AE Script as well, especially when you start with a full comp sized rectangle and ther math is simple...

               

              Mylenium

              • 4. Re: Looking for a script or plug-in
                Rick Gerard Adobe Community Professional & MVP

                Maybe this would work. Set up an Illustrator document the size of the layer you want to divide up into triangles. Create a rectangle. Switch to the line tool and draw a bunch of lines crossing the rectangle using the Smart Guides to snap to edges and vertices.

                Screen Shot 2016-06-10 at 6.38.20 AM.png

                Select all and then use the pathfinder tool - Divide to get a group:

                Screen Shot 2016-06-10 at 6.38.56 AM.png

                Select the group layer and use Sequence layers to separate all the triangles into layers:

                Screen Shot 2016-06-10 at 6.39.11 AM.png

                Drag all the new layers above layer 1 and import the AI file as a comp to get perfectly matching triangles

                Screen Shot 2016-06-10 at 6.39.53 AM.png

                One is out of place so you can see them. Another option would be to select all and copy and then go to AE and paste to create a mask for each of the shapes.

                 

                This would take about 2 minutes.

                • 5. Re: Looking for a script or plug-in
                  Gutter-Fish Level 4

                  Ah thank you Rick,

                   

                  I think this will work.  I did a quick test and ran into a problem because of the way I drew the lines (wound up with self intersecting masks) but I should be able to correct that. 

                   

                  One thing I could not do correctly though was

                  Another option would be to select all and copy and then go to AE and paste to create a mask for each of the shapes.

                  I drag select everything in Ai

                  CTRL C (and tried menu too (and tried CTRL X too))

                  go to Ae

                  Try to paste

                  No beuno

                   

                  But in the end I think this is going to work.

                   

                  As an aside, it seems like there would be a script like this out there somewhere.  I bet there is.  I'll find it eventually.

                   

                  Cheers

                  • 6. Re: Looking for a script or plug-in
                    Rick Gerard Adobe Community Professional & MVP

                    In Illustrator press the a key to bring up the direct selection tool after you have divided the rectangle and have a group then drag a selection around all of the elements and copy (Ctrl/Cmnd +c). Go to AE, select the layer and paste(Ctrl/Cmnd+v). If you still have problems choose the pen tool (g) in AE and click anywhere on the layer once to start a mask and then paste using the keyboard shortcut.

                     

                    You are going to get some thin areas of transparency so it might be a good idea to open up all of the masks, drag a selection around all of the mask properties, change the mask mode from difference to add and then expand all of the masks by one pixel.  Your layer will now not look like it's been sliced up until you move things around.

                    • 7. Re: Looking for a script or plug-in
                      Gutter-Fish Level 4

                      Oh that makes sense.   The problem is I was testing the process with text.   I made some text in Ai, converted it to outlines then followed the rest of your instructions which is why i could not paste it (I was just trying to paste it into the layer panel without any layer...& tried he project panel).   What I did was import the Ai file to Ae, convert it to shapes and then used a script to convert the shapes to masks.  The Newton plug in takes care of putting all the masks on separate layers.  Like I said the problem I ran into was self intersecting masks but that's just because I drew intersecting lines in Ai.

                       

                      It was still a pretty quick process though even with using text so thanks a ton for the help.