3 Replies Latest reply on Oct 22, 2016 2:14 PM by EnsilZah_

    Scripting Free Transform Warp

    Sergey Kritskiy Level 1

      Hey everyone,


      So I'm trying to understand how AM version of Free Transform custom warp works (standard 4x4 UVs). I have a quare (100x100) in 300x300 document.

      I'm getting 16 points, 12 of which are corners and control points (green arrows) and 4 are control points in the middle (red arrows). I'm having a hard time understanding how those 4 inner points are calculated



      For instance if I move top left side of the square slightly up the coordinate I'm getting from scriptlistener for point #5 (top left red dot on previous image) is 133 by X (the same as in original state) and -117px by Y (original was 133). So it moved 250px upwards, but visually the point moved 33px.

      In the same time point #9 (bottom left red dot) has the same coordinate as in original state (133, 166) but visually it also moved.


      Any thoughts?




        • 1. Re: Scripting Free Transform Warp
          Tom Winkelmann Level 3

          Fill your square with a checkerboard pattern and try free transform warp once more - so you can see, what's going on...

          • 2. Re: Scripting Free Transform Warp
            Sergey Kritskiy Level 1

            My square has a pattern (not really visible on sreenshots) but it doesn't really help with figuring out of weird AM numbers.

            • 3. Re: Scripting Free Transform Warp
              EnsilZah_ Level 1

              I've only had a chance to look at it for a little bit, and I haven't had a chance to see it in a cleaner form, but here's my speculation.

              There are also four points that define the the basic corner-pin type transform (idTop, idBtom...).

              The coordinates of the 16 points are relative to those points, so if you change the the coordinates of the four points from (100, 100, 200, 200) to (0,0,1,1) and then change all the points correspondingly eg. (133.3333... to 0.33333333) they would still perform the same function.


              Now, as to the 16 points, they're named 'rationalPoint', googling which lead me here: Elliptic curve - Wikipedia
              I'm not familiar with the math myself, but looking at the pictures leads me to believe it might be related, some sort of coordinate system within the previously defined rectangle, that would also have to account for the Bezier-curve-looking handles that don't seem to be represented in the code.


              Or, I think Bézier surface - Wikipedia this might be of use.