• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Reset transformation of every smart object in a PSD file

Community Beginner ,
Aug 09, 2023 Aug 09, 2023

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.

TOPICS
macOS

Views

295

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 09, 2023 Aug 09, 2023

@Aaron22017780e7jg 

 

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
...

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 09, 2023 Aug 09, 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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2023 Aug 09, 2023

Copy link to clipboard

Copied

@Aaron22017780e7jg 

 

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);
    }
}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run:

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 10, 2023 Aug 10, 2023

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2023 Aug 10, 2023

Copy link to clipboard

Copied

LATEST

You’re welcome @Aaron22017780e7jg 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines