1 回答

TA贡献1858条经验 获得超8个赞
如果我对您的理解正确,则希望将所有图像层的内容从一个组复制到单个目标层。
您可以通过直观地遍历组图艺术图层并将它们的内容复制/粘贴到目标图层的直观方式来实现。在GUI中这可能看起来微不足道,但是从编程上来说,它太复杂了。
另一种方法,也许是一种更具编程性的方法,将是仅遍历组图艺术层,复制每个层并将其与目标层合并。我举一个例子:
var doc = app.activeDocument;
var target = doc.layers.getByName('target');
var group = doc.layerSets.getByName('images');
var gal = group.artLayers;
// Iterate through art layers from group "images"
for (var i = 0; i < gal.length; i++) {
// Duplicate current layer and put it before the target layer
var temp = gal[i].duplicate(target, ElementPlacement.PLACEBEFORE);
// Merge the current layer with the target
// (the target variable has to be updated because it's now a new merged layer)
target = temp.merge();
}
在简单的目标图层上可以很好地工作。现在,如果您的目标图层更加复杂(即,它具有混合属性,蒙版等),并且要保持该图层不变,则必须使用上面链接的“原位粘贴”方法。
添加回答
举报