admin管理员组文章数量:1123945
How would I get the layer index of the layer in the document?
Here is my existing code:
function getLayerInfoAtIndex(app, index) {
try {
app.echoToOE("start of getLayerInfoAtIndex");
var document = app.activeDocument;
app.echoToOE("2 part of getLayerInfoAtIndex");
var numberOfLayers = document.layers.length;
app.echoToOE("numberOfLayers=" + numberOfLayers);
for (var i = 0; i < numberOfLayers; i++){
var currentLayer = document.layers[i];
var layerName = currentLayer.name
app.echoToOE("layerName=" + layerName);
var layerIndex = currentLayer.index;
var layerIndex2 = currentLayer.layerIndex;
app.echoToOE("layerIndex=" + layerIndex);
app.echoToOE("layerIndex2=" + layerIndex2);
if (layerIndex == index){
app.echoToOE("found layer at index = " + index);
}
else if (layerIndex2 == index){
app.echoToOE("2 found layer at index = " + index);
}
}
}
catch(error) {
app.echoToOE("error" + error.message)
}
}
I pass this message to Photopea and I get the following:
I don't know how or where I'm getting the objects. But they are listed and they seem to be the same object. Here's that object expanded:
Actually, I'd like to get as much layer info as possible but the layer index is currently the minimum I need to get.
本文标签: photopeaHow to get the layer index of the layerStack Overflow
版权声明:本文标题:photopea - How to get the layer index of the layer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736610214a1945425.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论