Free transform: coordinates instead of H/V/Angle

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

tyr

Free transform: coordinates instead of H/V/Angle

Post by tyr »

Hey everyone!

Is there a way to set specific coordinates for bounding box points?

For example I'd like the right bottom point go to the right and down


in script listener I'm getting the code like that, which is skew + offset + rotation.. I don't think I understand how to use it
Code: Select allvar idTrnf = charIDToTypeID( "Trnf" );
    var desc22 = 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 );
    desc22.putReference( idnull, ref8 );
    var idFTcs = charIDToTypeID( "FTcs" );
    var idQCSt = charIDToTypeID( "QCSt" );
    var idQcsa = charIDToTypeID( "Qcsa" );
    desc22.putEnumerated( idFTcs, idQCSt, idQcsa );
    var idOfst = charIDToTypeID( "Ofst" );
        var desc23 = new ActionDescriptor();
        var idHrzn = charIDToTypeID( "Hrzn" );
        var idPxl = charIDToTypeID( "#Pxl" );
        desc23.putUnitDouble( idHrzn, idPxl, -1.354641 );
        var idVrtc = charIDToTypeID( "Vrtc" );
        var idPxl = charIDToTypeID( "#Pxl" );
        desc23.putUnitDouble( idVrtc, idPxl, 1.354641 );
    var idOfst = charIDToTypeID( "Ofst" );
    desc22.putObject( idOfst, idOfst, desc23 );
    var idWdth = charIDToTypeID( "Wdth" );
    var idPrc = charIDToTypeID( "#Prc" );
    desc22.putUnitDouble( idWdth, idPrc, 111.321839 );
    var idHght = charIDToTypeID( "Hght" );
    var idPrc = charIDToTypeID( "#Prc" );
    desc22.putUnitDouble( idHght, idPrc, 110.123894 );
    var idSkew = charIDToTypeID( "Skew" );
        var desc24 = new ActionDescriptor();
        var idHrzn = charIDToTypeID( "Hrzn" );
        var idAng = charIDToTypeID( "#Ang" );
        desc24.putUnitDouble( idHrzn, idAng, 11.594136 );
        var idVrtc = charIDToTypeID( "Vrtc" );
        var idAng = charIDToTypeID( "#Ang" );
        desc24.putUnitDouble( idVrtc, idAng, 0.000000 );
    var idPnt = charIDToTypeID( "Pnt " );
    desc22.putObject( idSkew, idPnt, desc24 );
    var idAngl = charIDToTypeID( "Angl" );
    var idAng = charIDToTypeID( "#Ang" );
    desc22.putUnitDouble( idAngl, idAng, 6.141111 );
    var idUsng = charIDToTypeID( "Usng" );
        var desc25 = new ActionDescriptor();
        var idHrzn = charIDToTypeID( "Hrzn" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc25.putUnitDouble( idHrzn, idPrc, -0.107773 );
        var idVrtc = charIDToTypeID( "Vrtc" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc25.putUnitDouble( idVrtc, idPrc, -0.096679 );
    var idPnt = charIDToTypeID( "Pnt " );
    desc22.putObject( idUsng, idPnt, desc25 );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idBcbc = charIDToTypeID( "Bcbc" );
    desc22.putEnumerated( idIntr, idIntp, idBcbc );
executeAction( idTrnf, desc22, DialogModes.NO );

Thanks!

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Free transform: coordinates instead of H/V/Angle

Post by Mike Hale »

tyr wrote:I don't think I understand how to use it.

You are not the only one not to understand the transform coordinates in the scriptlistener log. If it is a simple type of transform like translate, scale, rotate then the values in the log match what was the options bar. But I have never be able to work out how to control the other types of transform with a script( other than storing a specific transform ).
tyr

Free transform: coordinates instead of H/V/Angle

Post by tyr »

Thanks for the answer, Mike!

Oh crap. What I was trying to achieve is to transform a layer based on coordinates of rectangular path, like that:


Am I right that this cannot be done?
Mike Hale

Free transform: coordinates instead of H/V/Angle

Post by Mike Hale »

Over the years I have learned not to say 'it can't be done'. But I have never been able to work how how to do it.
tyr

Free transform: coordinates instead of H/V/Angle

Post by tyr »

Thanks!
I've showed all this to a coder friend of mine and he just waved a hand saying 'oh sure that's a simple 3rd order bezier plane, give me a second', and now he's gone for two hours, I guess my Ultimate Bounding Distorter script will never be finished