Question
distort a layer / smartlayer by four coordinates
Hi all,
I want to distort (free transform) the four corners of a layer (rectangle shape) to 4 specific coordinates.
For example: [[971,776],[1518,688],[1519,974],[968,1312]]
Scriptlistener showed this, but I dont see any coordinates:
// =======================================================
var idTrnf = charIDToTypeID( "Trnf" );
var desc252 = new ActionDescriptor();
var idFTcs = charIDToTypeID( "FTcs" );
var idQCSt = charIDToTypeID( "QCSt" );
var idQcsa = charIDToTypeID( "Qcsa" );
desc252.putEnumerated( idFTcs, idQCSt, idQcsa );
var idOfst = charIDToTypeID( "Ofst" );
var desc253 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
var idPxl = charIDToTypeID( "#Pxl" );
desc253.putUnitDouble( idHrzn, idPxl, 700.958190 );
var idVrtc = charIDToTypeID( "Vrtc" );
var idPxl = charIDToTypeID( "#Pxl" );
desc253.putUnitDouble( idVrtc, idPxl, 367.508658 );
var idOfst = charIDToTypeID( "Ofst" );
desc252.putObject( idOfst, idOfst, desc253 );
var idWdth = charIDToTypeID( "Wdth" );
var idPrc = charIDToTypeID( "#Prc" );
desc252.putUnitDouble( idWdth, idPrc, 148.730064 );
var idHght = charIDToTypeID( "Hght" );
var idPrc = charIDToTypeID( "#Prc" );
desc252.putUnitDouble( idHght, idPrc, 92.668201 );
var idSkew = charIDToTypeID( "Skew" );
var desc254 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
var idAng = charIDToTypeID( "#Ang" );
desc254.putUnitDouble( idHrzn, idAng, -3.365472 );
var idVrtc = charIDToTypeID( "Vrtc" );
var idAng = charIDToTypeID( "#Ang" );
desc254.putUnitDouble( idVrtc, idAng, 0.000000 );
var idPnt = charIDToTypeID( "Pnt " );
desc252.putObject( idSkew, idPnt, desc254 );
var idAngl = charIDToTypeID( "Angl" );
var idAng = charIDToTypeID( "#Ang" );
desc252.putUnitDouble( idAngl, idAng, 0.490732 );
var idUsng = charIDToTypeID( "Usng" );
var desc255 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
var idPrc = charIDToTypeID( "#Prc" );
desc255.putUnitDouble( idHrzn, idPrc, 0.086137 );
var idVrtc = charIDToTypeID( "Vrtc" );
var idPrc = charIDToTypeID( "#Prc" );
desc255.putUnitDouble( idVrtc, idPrc, -0.010603 );
var idPnt = charIDToTypeID( "Pnt " );
desc252.putObject( idUsng, idPnt, desc255 );
var idreplaceLayer = stringIDToTypeID( "replaceLayer" );
var desc256 = new ActionDescriptor();
var idFrom = charIDToTypeID( "From" );
var ref6 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref6.putIdentifier( idLyr, 26 );
desc256.putReference( idFrom, ref6 );
var idT = charIDToTypeID( "T " );
var ref7 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref7.putIdentifier( idLyr, 26 );
desc256.putReference( idT, ref7 );
var idTrnf = charIDToTypeID( "Trnf" );
desc252.putObject( idreplaceLayer, idTrnf, desc256 );
executeAction( idTrnf, desc252, DialogModes.NO );
