Copy link to clipboard
Copied
Hi, I'm looking to repeat a smart object many times, adding a rotation each time, like the step and repeat method here https://www.youtube.com/watch?v=wY1bx5z3tqw (I had been just doing this with transforming layers like in the video but losing image quality). At the moment I'm ctrl+j then manually moving anchor point and rotating each time, is there a quicker way? (PS- largely self taught with PS so still getting my head riund how smart objects work!)
Copy link to clipboard
Copied
You tried different interpretation methods to see if any work better then others, All your duplicated smart object layers share share the sane object. All the layers have an object transform recorded in the layer that transforms the same harden object pixels for the layers use of the object. It like each layer has done a single transform of the object. Each layer has a different transform and the transform layer are blended in the composite all the layer should have about the same image quality the scale was not change the rotation point was changes and the amount or rotation was change the number of pixels should not change. Because you moved the Rotation point and changed the angle of rotation by hand the quality of the interpolation may differ slightly. A script design to do the rotation amount and rotation point moving would do a more precise job. I have had problems with this is 22.5.1 where the rotation seem off. Restarting 22.5.1 and redoing the process worked correctly.
Here I converted a a 5 sided polygon shape layer to a smart object layer. Then Rotated the smart object layer around the 5 the 5 control points the original shape layer had. The smart object layer was rotated 360 degrees 5 times at each control points. 360/5 control points 72 degrees. So at each control point the smart object layer was duplicated and rotated 72 degrees 4 times around the current control point. so the a total of 21 smart object layers. 20 smat object layers were add in the process. You can see how precisely the rotation was was done by how well the layers line up with each other with the 5 precise rotation control points and the calulated 72 degree rotation.
Copy link to clipboard
Copied
Something like this might work:
// 2021, use it at your own risk;
if (app.documents.length > 0) {
var myDocument = activeDocument;
var layerId = getLayerId ();
var thisAngle = 15;
var theScale = 5;
for (var m = 0; m < 15; m++) {
layerDuplicateScaleRotate (layerId, 0, 0, 100+theScale*(m+1), 100+theScale*(m+1), thisAngle*(m+1));
};
};
////// duplicate layer (id, xOffset, yOffset, theXScale, theYScale, theAngle) //////
function layerDuplicateScaleRotate (theID, xOffset, yOffset, theXScale, theYScale, theAngle) {
// based on code by mike hale, via paul riggott;
var ref = new ActionReference();
ref.putIdentifier(charIDToTypeID("Lyr "), theID);
var desc = new ActionDescriptor();
desc.putReference(charIDToTypeID("null"), ref );
desc.putBoolean( charIDToTypeID( "MkVs" ), false );
try{
executeAction(charIDToTypeID("slct"), desc, DialogModes.NO );
}catch(e){
alert(e.message);
};
// =======================================================
var desc23 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref2 = new ActionReference();
ref2.putIdentifier ( charIDToTypeID( "Lyr " ), theID );
// ref2.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc23.putReference( idnull, ref2 );
desc23.putEnumerated( charIDToTypeID( "FTcs" ), charIDToTypeID( "QCSt" ), charIDToTypeID( "Qcsa" ) );
var idOfst = charIDToTypeID( "Ofst" );
var desc24 = new ActionDescriptor();
var idPxl = charIDToTypeID( "#Pxl" );
desc24.putUnitDouble( charIDToTypeID( "Hrzn" ), idPxl, xOffset );
desc24.putUnitDouble( charIDToTypeID( "Vrtc" ), idPxl, yOffset );
var idOfst = charIDToTypeID( "Ofst" );
desc23.putObject( idOfst, idOfst, desc24 );
var idPrc = charIDToTypeID( "#Prc" );
desc23.putUnitDouble( charIDToTypeID( "Wdth" ), idPrc, theXScale );
desc23.putUnitDouble( charIDToTypeID( "Hght" ), idPrc, theXScale );
desc23.putUnitDouble( charIDToTypeID( "Angl" ), charIDToTypeID( "#Ang" ), theAngle );
desc23.putEnumerated( charIDToTypeID( "Intr" ), charIDToTypeID( "Intp" ), stringIDToTypeID( "bicubicAutomatic" ) );
// lower left corner;
desc23.putEnumerated( stringIDToTypeID( "freeTransformCenterState" ), stringIDToTypeID( "quadCenterState" ), stringIDToTypeID( "QCSCorner3" ) );
desc23.putBoolean( charIDToTypeID( "Cpy " ), true );
executeAction( charIDToTypeID( "Trnf" ), desc23, DialogModes.NO );
};
////// get active layer’s id //////
function getLayerId () {
var ref = new ActionReference();
ref.putProperty (stringIDToTypeID ("property"), stringIDToTypeID ("layerID"));
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
return executeActionGet(ref).getInteger(stringIDToTypeID("layerID"));
};
Find more inspiration, events, and resources on the new Adobe Community
Explore Now