7 Replies Latest reply on Feb 24, 2014 11:11 AM by dancemantron

    How to Action\Script converting many Shape Paths into single masks' path keyframes?

    dancemantron

      Hello AEProComm.,..

                    i've have a motion problem that If solved is one substantial step  for motion Artists toward "efficient" animation of almost everything:

      I have a few dozen Adobe Illustrator Shape Layers, imported to A.E. with paths "Created..from Vector Layers".

      In order to use a jsxbin script to change every path to the same number of verticies (min.req. to animate masks) i must 1st convert them to Keyframes on the same Mask Path property.

       

      1) could someone please show how, perhaps know of or help with script\Action  to convert or paste Keyframes from Shape Paths onto a single Masks' path Keyframes?

       

      Any help always greatly appreciated,

      J

        • 1. Re: How to Action\Script converting many Shape Paths into single masks' path keyframes?
          Rick Gerard Adobe Community Professional & MVP

          I'm sorry I don't follow you. All you have to do to convert a mask path to a position keyframes is set a keyframe for the mask path, copy, then set any position keyframe for a layer's position property and paste.

           

          All you have to do to convert a vector shape in Illustrator to a motion path is do the same thing, copy the path and paste.

           

          All you have to do to convert a motion path to a mask path is select all of the motion keyframes, copy, use the pen tool to set an initial mask vertex anywhere on a layer and paste.

           

          Are you trying to automate this?

           

          Are you trying to join multiple motion paths to a single mask?

           

          I'm not much help because I don't know what you are trying to do.

          • 2. Re: How to Action\Script converting many Shape Paths into single masks' path keyframes?
            dancemantron Level 1

            Hi Rick,

                        you got it right, but instead of: "All you have to do to convert a mask path to a position keyframes is,.."

             

            ...the answer i need is: "All you have to do to convert MULTIPLE mask path(S) SIMULTANEOUSLY to a position keyframes is.."

             

            yes, i am trying to automate this.

             

            1) in Adobe Illustrator i have dozens of closed paths in a vertical layer stack,

             

            2) i import the AI file into After Effects, then use "Create Shapes from Vector Layer". This releases the AI path into individual Outline\Shapes layer groups containing a Path > Path property

             

            3) i then use a script that removes each path to place them in a new layer in a vertical Mask > Path stack,

             

            This is where i'm stuck, because rather than copy and pasting dozens of mask paths onto a Single masks' Path as keyframes one at a time i wrote this to find a way to copy and paste or convert them all simultaneously, possibly thru batch scripts, expressions or any effective instructions or help. Hopefully this is easier to understand,

            thanks again,

            J

            • 3. Re: How to Action\Script converting many Shape Paths into single masks' path keyframes?
              Rick Gerard Adobe Community Professional & MVP

              A closed path cannot be merged into another closed path. Mathematically and practically impossible. A closed path is closed and therefore a single path.

               

              I still am not sure what you are trying to do because I can't visualize the motion you want to end up with. You could fairly easily write a script that would create dozens of layers each following the path of a mask applied to a matching layer. You could then sequence those layers so that the motion of one layer would end when when the motion of another layer would start. You could then, through parenting or expressions tie the motion of all layers to a null so that the null would move in one continuous path.

               

              Just try to explain what you would like to happen with two closed paths. Layer 1 has a rectangular path with 4 points, layer two has a eliptical path with 4 points. The resulting motion for layer 3 would be what? What would happen to layer 3 between the last vertex of the rectangle and the first vertex of the elipse (circle).

              • 4. Re: How to Action\Script converting many Shape Paths into single masks' path keyframes?
                dancemantron Level 1

                ...don't know how to explain it any more simply esp. after showing the exact steps i've taken and where the specific problem stops me: to simply paste or convert MORE THAN ONE Shape Path at a time  into a single masks' path keyframes. If you read my entire thread its nothing to do with merging closed paths, and there no motion to understand. It really is as simple as i've repeated.

                So thanks for trying but never mind, i'll figure it,

                g'nite

                • 5. Re: How to Action\Script converting many Shape Paths into single masks' path keyframes?
                  Mylenium Most Valuable Participant

                  That's impossible. How should a mask with a limited number of points be able to magically create a compound construct. The same mathematical and technical rules Rick was hinting at apply. You want the impossible.

                   

                  Mylenium

                  • 6. Re: How to Action\Script converting many Shape Paths into single masks' path keyframes?
                    Rick Gerard Adobe Community Professional & MVP

                    You said:

                    1) in Adobe Illustrator i have dozens of closed paths in a vertical layer stack,

                     

                    2) i import the AI file into After Effects, then use "Create Shapes from Vector Layer". This releases the AI path into individual Outline\Shapes layer groups containing a Path > Path property

                     

                    3) i then use a script that removes each path to place them in a new layer in a vertical Mask > Path stack,

                    I don't know what 3 means. What I can guess is that you want to write a script that will go through a stack of layers with closed mask paths and apply those mask paths to a layer path. What layer. The same layer? A different layer? A new layer with a motion path? All of the motion paths applied to a single layer? I have no idea what you are trying to do and it would not take ESP to figure it out. It would just take a very simple explanation.

                     

                    You can do 1 without automation, 2 can be handled with a simple script. If I knew what 3 was I could help.

                     

                    Using my example, a rectangular path and a circle.. What happens to each. One scenario is that the rectangle is turned into a shape layer using Create Shape from Vector Layer, then the vector shape is turned into a mask with Auto Trace. You could eliminate the Create Shape from Vector Layer and just use AutoTrace and archive a layer with a mask in one step. You can even use Auto Trace on multiple layers so the Rectangle and the Circle imported from Illustrator would be turned into layers with masks. IOW, if you had 40 shape layers in AE and you wanted to create 40 masks from those 40 shape layers you would just select them all and go to Layer>AutoTrace Select current frame and you have 40 new layers with masks.

                     

                    BTW, if you have an animated mask with 2 or more keyframes and select all of the mask keyframes and paste them to the position of a layer the layer will move around the path of the first keyrame, then the path of the second, then the path of the third and so on until it's done. The motion path will not follow the changing path shape.

                     

                    If you have multiple masks on a layer or multiple layers with one mask you cannot select all of the mask paths at once, copy them, and paste the data from multiple masks to a motion path. The mask paths must be copied one at a time and pasted one at a time. That's a limitation you have to work with.

                     

                    So my question remains, If you had a rectangle and a circle created in Illustrator, what would you like to happen to them in After Effects? Explaining that scenario will not require ESP and you'll get some help. The After Effects Scripting forum can give you help on writing the script.

                    • 7. Re: How to Action\Script converting many Shape Paths into single masks' path keyframes?
                      dancemantron Level 1

                      ...as i'd written, nevermind, i've got this - figured it out last night, was'nt impossible, just was'nt at all what you thought it was,

                      thx,

                      J

                       

                      and PS: you did understand writing: "..If you have multiple masks on a layer or multiple layers with one mask you cannot select all of the mask paths at once, copy them, and paste the data from multiple masks to a motion path. The mask paths must be copied one at a time and pasted one at a time. That's a limitation you have to work with...",

                       

                      ..and the answer i found is Extenscript Toolkit which does allow you to read, copy and paste any/all keyframe properties and values with consecutive, virtually simultaneous speed.

                       

                       

                      One last thing, correct me if i'm wrong but i hope i have'nt written anything to cause the animosity i think i'm sensing in your replies?, i realized long ago how easy it is to misinterpret anothers feelings online without a voice or facial cues to confirm\deny them. Especially you Mylenium whose code and creations have earned you respect (mine included) many times over, but whom the Emperor reading your replies would have said: "good,..Good!, i can feel! your anger" LOL(ofcourse), hope your laughing to. Your all obvious pro's whose opinions we continue to respect or why come here. I'd like to continue to do so,

                      appreciate it,

                      J