How can I convert layer to smart object in Photoshop?

懵懂的女人 提交于 2021-01-27 05:11:12

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/40617888/how-can-i-convert-layer-to-smart-object-in-photoshop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!