2 Replies Latest reply on Jul 5, 2013 2:01 AM by Pedro Cortez Marques

    DialogModes.ALL with "customEnvelopeWarp" with warp dialogue active. Possible?

    Pedro Cortez Marques Level 3

      I have manage to listener warp tool on a pixel layer.

       

      It's a huge ammount of code for customEnvelopeWarp, but in short words:

       

      1. I want it o stop before applying Transform;

      2. All the vallues should be reseted (waiting for me to warp);

      3. Very important!! I want to have NOT the transform normal dialog window but the warp window when stoped (see image bellow)

       

      I want to avoid right-click to activate the warp dialog window: when stoped, warp should be seen directly

      example.jpg

       

      Is this possible?

       

       

      This is an example of code transforming a pixel layer:

      var idTrnf = charIDToTypeID( "Trnf" );
          var desc78 = new ActionDescriptor();
          var idnull = charIDToTypeID( "null" );
              var ref13 = new ActionReference();
              var idLyr = charIDToTypeID( "Lyr " );
              var idOrdn = charIDToTypeID( "Ordn" );
              var idTrgt = charIDToTypeID( "Trgt" );
              ref13.putEnumerated( idLyr, idOrdn, idTrgt );
          desc78.putReference( idnull, ref13 );
          var idFTcs = charIDToTypeID( "FTcs" );
          var idQCSt = charIDToTypeID( "QCSt" );
          var idQcsa = charIDToTypeID( "Qcsa" );
          desc78.putEnumerated( idFTcs, idQCSt, idQcsa );
          var idOfst = charIDToTypeID( "Ofst" );
              var desc79 = new ActionDescriptor();
              var idHrzn = charIDToTypeID( "Hrzn" );
              var idPxl = charIDToTypeID( "#Pxl" );
              desc79.putUnitDouble( idHrzn, idPxl, 0.237643 ); 
              var idVrtc = charIDToTypeID( "Vrtc" );
              var idPxl = charIDToTypeID( "#Pxl" );
              desc79.putUnitDouble( idVrtc, idPxl, 0.083618 ); 
          var idOfst = charIDToTypeID( "Ofst" );
          desc78.putObject( idOfst, idOfst, desc79 );
          var idWdth = charIDToTypeID( "Wdth" );
          var idPrc = charIDToTypeID( "#Prc" );
          desc78.putUnitDouble( idWdth, idPrc, 100.028098 ); 
          var idHght = charIDToTypeID( "Hght" );
          var idPrc = charIDToTypeID( "#Prc" );
          desc78.putUnitDouble( idHght, idPrc, 99.981666 );
          var idwarp = stringIDToTypeID( "warp" );
              var desc80 = new ActionDescriptor();
              var idwarpStyle = stringIDToTypeID( "warpStyle" );
              var idwarpStyle = stringIDToTypeID( "warpStyle" );
              var idwarpCustom = stringIDToTypeID( "warpCustom" );
              desc80.putEnumerated( idwarpStyle, idwarpStyle, idwarpCustom );
              var idwarpValue = stringIDToTypeID( "warpValue" );
              desc80.putDouble( idwarpValue, 0.000000 );
              var idwarpPerspective = stringIDToTypeID( "warpPerspective" );
              desc80.putDouble( idwarpPerspective, 0.000000 );
              var idwarpPerspectiveOther = stringIDToTypeID( "warpPerspectiveOther" );
              desc80.putDouble( idwarpPerspectiveOther, 0.000000 );
              var idwarpRotate = stringIDToTypeID( "warpRotate" );
              var idOrnt = charIDToTypeID( "Ornt" );
              var idHrzn = charIDToTypeID( "Hrzn" );
              desc80.putEnumerated( idwarpRotate, idOrnt, idHrzn );
              var idbounds = stringIDToTypeID( "bounds" );
                  var desc81 = new ActionDescriptor();
                  var idTop = charIDToTypeID( "Top " );
                  var idPxl = charIDToTypeID( "#Pxl" );
                  desc81.putUnitDouble( idTop, idPxl, 198.000000 );
                  var idLeft = charIDToTypeID( "Left" );
                  var idPxl = charIDToTypeID( "#Pxl" );
                  desc81.putUnitDouble( idLeft, idPxl, 42.000000 );
                  var idBtom = charIDToTypeID( "Btom" );
                  var idPxl = charIDToTypeID( "#Pxl" );
                  desc81.putUnitDouble( idBtom, idPxl, 1108.000000 );
                  var idRght = charIDToTypeID( "Rght" );
                  var idPxl = charIDToTypeID( "#Pxl" );
                  desc81.putUnitDouble( idRght, idPxl, 1711.000000 );
              var idRctn = charIDToTypeID( "Rctn" );
              desc80.putObject( idbounds, idRctn, desc81 );
              var iduOrder = stringIDToTypeID( "uOrder" );
              desc80.putInteger( iduOrder, 4 );
              var idvOrder = stringIDToTypeID( "vOrder" );
              desc80.putInteger( idvOrder, 4 );
              var idcustomEnvelopeWarp = stringIDToTypeID( "customEnvelopeWarp" );
                  var desc82 = new ActionDescriptor();
                  var idmeshPoints = stringIDToTypeID( "meshPoints" );
                      var list5 = new ActionList();
                          var desc83 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc83.putUnitDouble( idHrzn, idPxl, 42.000000 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc83.putUnitDouble( idVrtc, idPxl, 198.000000 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc83 );
                          var desc84 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc84.putUnitDouble( idHrzn, idPxl, 598.333333 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc84.putUnitDouble( idVrtc, idPxl, 198.000000 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc84 );
                          var desc85 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc85.putUnitDouble( idHrzn, idPxl, 1154.666667 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc85.putUnitDouble( idVrtc, idPxl, 198.000000 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc85 );
                          var desc86 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc86.putUnitDouble( idHrzn, idPxl, 1733.524715 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc86.putUnitDouble( idVrtc, idPxl, 195.832765 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc86 );
                          var desc87 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc87.putUnitDouble( idHrzn, idPxl, 42.000000 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc87.putUnitDouble( idVrtc, idPxl, 501.333333 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc87 );
                          var desc88 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc88.putUnitDouble( idHrzn, idPxl, 598.333333 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc88.putUnitDouble( idVrtc, idPxl, 501.333333 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc88 );
                          var desc89 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc89.putUnitDouble( idHrzn, idPxl, 1154.666667 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc89.putUnitDouble( idVrtc, idPxl, 501.333333 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc89 );
                          var desc90 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc90.putUnitDouble( idHrzn, idPxl, 1711.000000 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc90.putUnitDouble( idVrtc, idPxl, 501.333333 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc90 );
                          var desc91 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc91.putUnitDouble( idHrzn, idPxl, 42.000000 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc91.putUnitDouble( idVrtc, idPxl, 804.666667 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc91 );
                          var desc92 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc92.putUnitDouble( idHrzn, idPxl, 598.333333 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc92.putUnitDouble( idVrtc, idPxl, 804.666667 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc92 );
                          var desc93 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc93.putUnitDouble( idHrzn, idPxl, 1154.666667 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc93.putUnitDouble( idVrtc, idPxl, 804.666667 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc93 );
                          var desc94 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc94.putUnitDouble( idHrzn, idPxl, 1711.000000 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc94.putUnitDouble( idVrtc, idPxl, 804.666667 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc94 );
                          var desc95 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc95.putUnitDouble( idHrzn, idPxl, 42.000000 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc95.putUnitDouble( idVrtc, idPxl, 1108.000000 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc95 );
                          var desc96 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc96.putUnitDouble( idHrzn, idPxl, 598.333333 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc96.putUnitDouble( idVrtc, idPxl, 1108.000000 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc96 );
                          var desc97 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc97.putUnitDouble( idHrzn, idPxl, 1154.666667 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc97.putUnitDouble( idVrtc, idPxl, 1108.000000 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc97 );
                          var desc98 = new ActionDescriptor();
                          var idHrzn = charIDToTypeID( "Hrzn" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc98.putUnitDouble( idHrzn, idPxl, 1711.000000 );
                          var idVrtc = charIDToTypeID( "Vrtc" );
                          var idPxl = charIDToTypeID( "#Pxl" );
                          desc98.putUnitDouble( idVrtc, idPxl, 1108.000000 );
                      var idrationalPoint = stringIDToTypeID( "rationalPoint" );
                      list5.putObject( idrationalPoint, desc98 );
                  desc82.putList( idmeshPoints, list5 );
              var idcustomEnvelopeWarp = stringIDToTypeID( "customEnvelopeWarp" );
              desc80.putObject( idcustomEnvelopeWarp, idcustomEnvelopeWarp, desc82 );
          var idwarp = stringIDToTypeID( "warp" );
          desc78.putObject( idwarp, idwarp, desc80 );
          var idIntr = charIDToTypeID( "Intr" );
          var idIntp = charIDToTypeID( "Intp" );
          var idBcbc = charIDToTypeID( "Bcbc" );
          desc78.putEnumerated( idIntr, idIntp, idBcbc );
      executeAction( idTrnf, desc78, DialogModes.ALL );