3 Replies Latest reply on Aug 17, 2014 4:19 PM by JJJ_Monsta

    world space coordinates of trim paths

    JJJ_Monsta Level 1

      I'm curious if there is a way to get the position in world space (or any coordinate system really, can be comp) of the offset value of my trim curves on a shape layer.  Basically I have a little glowing highlight I made using trim curves traveling around the perimeter of my frame and I am trying to track it via expressions on a 3D object.  Obviously the offset value has no x and y coordinates, but I am wondering if there is a way to figure it out based on layer width/height and the value of the offset.


      Thanks for any advice!



        • 1. Re: world space coordinates of trim paths
          Rick Gerard Adobe Community Professional & MVP

          Not likely because the path information in the curve is not directly accessible through expressions. You could figure out the percentage of the path that is left but you cannot access the coordinates of the path itself.


          Here's what you could do. You could copy the path and paste that to a motion path by setting a keyframe for the shape layer path, copying that path, then create a null and set a single keyframe for the null's position and with that keyframe selected perform a paste. Now you have x and y positions for the entire path. You could then attach your layer to the null with parenting and simply adjust the timing by dragging the last keyframe for the motion to match the trim path movement. That would take about two minutes.

          • 2. Re: world space coordinates of trim paths
            JJJ_Monsta Level 1

            Thanks for the great idea!  That sounds like it would do the trick.

            I almost have it figured out via an expression as well.  I noticed the offset value is controlled by degrees.  If I can just figure out which right triangle to use in order to calculate that degrees measurement I can use arc tan to figure out the x, y position of the trim on my square/rectangle frame.  It's then easy to get the world space position from there.  Just have not figured out what angle is being used to generate that degrees value in the trim offset.  It can't be from the center of the square because 0 degrees is at the top right corner.  Hope that makes sense...it does in my brain anyways. Lol!

            • 3. Re: world space coordinates of trim paths
              JJJ_Monsta Level 1

              I'm having a hard time getting that solution to work.  Any chance you could provide a quick example for me to go over?