Copy link to clipboard
Copied
Is there a simple way to reset the transformation for every single smart object in a PSD? I know how to do it for a single layer/object but selecting multiple at a time seems to grey out that option for me.
The following script will reset smart object transformations on all smart objects as top-level layers or inside groups and nested groups. It doesn't edit the smart object for nested smart objects within smart objects, only the top-level smart object is reset.
/*
Reset All Smart Object Layer Transformations.jsx
https://community.adobe.com/t5/photoshop-ecosystem-discussions/reset-transformation-of-every-mart-object-in-a-psd-file/td-p/13997343
Stephen Marsh, 10th August 2023
...
Copy link to clipboard
Copied
A script can do this, looping over all layers and only processing smart object layers.
Do you only have a single top-level smart object? Do you have smart object layers inside layer group folders? Do you have groups nested inside other groups?
Or do you have a smart object that may contain a nested smart object etc.
Can you post a screenshot of your layers panel?
Copy link to clipboard
Copied
The following script will reset smart object transformations on all smart objects as top-level layers or inside groups and nested groups. It doesn't edit the smart object for nested smart objects within smart objects, only the top-level smart object is reset.
/*
Reset All Smart Object Layer Transformations.jsx
https://community.adobe.com/t5/photoshop-ecosystem-discussions/reset-transformation-of-every-mart-object-in-a-psd-file/td-p/13997343
Stephen Marsh, 10th August 2023 - v1.0
*/
#target photoshop
var myDocument = activeDocument;
myDocument.suspendHistory("processAllSmartObjects", "processSOLayers(myDocument)");
// processSOLayers function courtesy of c.pfaffenbichler
function processSOLayers(theParent) {
// Loop over all the layers
for (var i = theParent.layers.length - 1; i >= 0; i--) {
var theLayer = theParent.layers[i];
// Apply the function to smart object layers
if (theLayer.typename === "ArtLayer") {
if (theLayer.kind === LayerKind.SMARTOBJECT) {
var theVisibility = theLayer.visible;
myDocument.activeLayer = theLayer;
// Run the function to reset transformations
resetTransforms();
// Reset visibility;
theLayer.visible = theVisibility;
}
// Run the function on the smart object layers inside layerSets (implied, not explicitly defined)
} else {
processSOLayers(theLayer);
}
}
return;
function resetTransforms() {
var idplacedLayerResetTransforms = stringIDToTypeID("placedLayerResetTransforms");
executeAction(idplacedLayerResetTransforms, undefined, DialogModes.NO);
}
}
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop
Copy link to clipboard
Copied
Hi Stephen. Your script works perfectly, exactly what I needed thanks! My smart objects were scattered accross several layer groups, but it looks like they all got resized. Thanks a lot!
Copy link to clipboard
Copied
You’re welcome @Aaron22017780e7jg