Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert layer to smart object in Photoshop?

This script converts the active layer into a smart object:

createSmartObject(app.activeDocument.activeLayer);
function createSmartObject(layer)
{
    var idnewPlacedLayer = stringIDToTypeID( 'newPlacedLayer' );
    executeAction(idnewPlacedLayer, undefined, DialogModes.NO);
}

My question: Is there a shorter way to code this?

like image 579
PHennessey Avatar asked Nov 15 '16 19:11

PHennessey


People also ask

What does convert to smart object mean in Photoshop?

A Smart Object is a Photoshop layer that contains all the same image information of a normal layer but a Smart Object layer will allow you to perform non-destructive edits. For example, you can resize the image as often as you want without causing any degradation. I demonstrate this later in the article.


1 Answers

createSmartObject();
function createSmartObject() {
    var idnewPlacedLayer = stringIDToTypeID( 'newPlacedLayer' );
    executeAction(idnewPlacedLayer, undefined, DialogModes.NO);
}

You don't need to pass the layer into the function--it acts upon whatever the current active layer happens to be.

like image 174
brandonbee Avatar answered Oct 11 '22 13:10

brandonbee