Mobile app version of vmapp.org
Login or Join
Jessie844

: Photoshop CS6 Scripting - Manipulate Transform Reference Point When scripting the Photoshop CS6 Transform, you can set the center to rotate or scale around a point by specifying the AnchorPosition

@Jessie844

Posted in: #AdobePhotoshop #PhotoshopScripting

When scripting the Photoshop CS6 Transform, you can set the center to rotate or scale around a point by specifying the AnchorPosition enum, such as AnchorPosition.BOTTOMCENTER for the bottom center, etc. The Transform tool also allows you to manually change the center by dragging around this "reference point" making it "independent" (the action term when you do this).

Is there a programmatic way to control the x, y coordinates to actually position of the "reference point" that transforms are rotated and scaled around using javascript?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie844

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gail6891361

This is to get you going. I dug this out form the script listener.

rotateCurrentLayer(-10 , 532, 412)

function rotateCurrentLayer( angle, X, Y){
var idTrnf = charIDToTypeID( "Trnf" );
var desc77 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref8 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref8.putEnumerated( idLyr, idOrdn, idTrgt );
desc77.putReference( idnull, ref8 );
var idFTcs = charIDToTypeID( "FTcs" );
var idQCSt = charIDToTypeID( "QCSt" );
var idQcsi = charIDToTypeID( "Qcsi" );
desc77.putEnumerated( idFTcs, idQCSt, idQcsi );
var idPstn = charIDToTypeID( "Pstn" );
var desc78 = new ActionDescriptor();
var idRlt = charIDToTypeID( "#Rlt" );
desc78.putUnitDouble( charIDToTypeID( "Hrzn" ), idRlt, X);
desc78.putUnitDouble( charIDToTypeID( "Vrtc" ), idRlt, Y);
var idPnt = charIDToTypeID( "Pnt " );
desc77.putObject( idPstn, idPnt, desc78 );
var idAng = charIDToTypeID( "#Ang" );
desc77.putUnitDouble( charIDToTypeID( "Angl" ), idAng, angle);
executeAction( idTrnf, desc77, DialogModes.NO );
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme