多个画板上的重复图层-Photoshop 2019 [英] Duplicate layers in multiple artboards - Photoshop 2019

查看:76
本文介绍了多个画板上的重复图层-Photoshop 2019的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法或脚本可以将图层复制到Photoshop中的所有画板上吗?

Is there any way or script to copy layer to all artboards in Photoshop?

请先谢谢您,因为我找不到解决方法

Thank you in advance, because I could not find a solution

推荐答案

画板只是专门的图层组,可以使用document.layerSets属性作为目标.在这个工作示例中(已在Adobe PS CC 2019中进行了测试和工作),我假设我们正在复制1层,并且每个画板中已经有1层.有关视觉演示,请查看以下截屏视频gif: https://www.rebel-ist.com/img/example/duplicateArtboards.gif

Artboards are just specialized layer groups, which can be targeted with the document.layerSets property. In this working example (tested and working in Adobe PS CC 2019), I make the assumption that there is 1 layer we are copying and each artboard has 1 layer already in it. For a visual demo, check out this screencast gif: https://www.rebel-ist.com/img/example/duplicateArtboards.gif

var doc = app.activeDocument;

// assumes your bottom most artboard in the layer tree contains the layer you want to copy from AKA Artboard 1
var artBoardToCopyFrom = doc.layerSets[doc.layerSets.length - 1];

// assumes there is only 1 layer in this artboard that we need to target
var layerToCopy = artBoardToCopyFrom.layers[0];

// set that layer as the active layer
doc.activeLayer = layerToCopy;

// select all 
doc.selection.selectAll();

// copy the selection
doc.selection.copy();


// loop through each layerSet aka artboard except the last one -- no need to paste an additional copy into the bottom most layerSet
for (var g = 0; g < doc.layerSets.length - 1; g++) {

    // set layer 0 in this group as the active layer -- again assumes there is only one layer in each artboard
    doc.activeLayer = doc.layerSets[g].artLayers[0];

        // select all
    doc.selection.selectAll();

    // paste into selection aka create new layer and paste with mask
    doc.paste(true);
}

这篇关于多个画板上的重复图层-Photoshop 2019的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆