Hi Christoph, sure it helps, thank you! Fascinating stuff, but I'm having a bit of a headache trying to understand the flow. I've set up a simple file such as: To understand better, I've used indexes rather than IDs. Looping through them gives:
name: A - index: 8
name: B - index: 7
name: B_one - index: 6
name: </Layer group> - index: 5
name: A_one - index: 4
name: </Layer group> - index: 3
name: One - index: 2
name: Layer 0 - index: 1
So as expected LayerSets have a layerSectionEnd that occupies an extra index. Doing extra log in your script returns:
setArray = [ ["A", 8] ]
theGroups = [ ["A", 8] ]
aNumber = 1
thisArray = [ ["B", 7] ]
thisArray = [ ["B", 7], ["A", 8] ]
theArray = [ [ ["B", 7], ["A", 8] ] ]
setArray = [ ["A", 8], ["B", 7] ]
theGroups = [ ["A", 8], ["B", 7] ]
aNumber = 2
thisArray = [ ["B_one", 6] ]
thisArray = [ ["B_one", 6], ["B", 7] ]
thisArray = [ ["B_one", 6], ["B", 7], ["A", 8] ]
theArray = [ [ ["B", 7], ["A", 8] ], [ ["B_one", 6], ["B", 7], ["A", 8] ] ]
thisArray = [ ["A_one", 4] ]
thisArray = [ ["A_one", 4], ["A", 8] ]
theArray = [ [ ["B", 7], ["A", 8] ], [ ["B_one", 6], ["B", 7], ["A", 8] ], [ ["A_one", 4], ["A", 8] ] ]
theArray = [ [ ["B", 7], ["A", 8] ], [ ["B_one", 6], ["B", 7], ["A", 8] ], [ ["A_one", 4], ["A", 8] ], [ ["One", 2] ] ]
theArray = [ [ ["B", 7], ["A", 8] ], [ ["B_one", 6], ["B", 7], ["A", 8] ], [ ["A_one", 4], ["A", 8] ], [ ["One", 2] ], [ ["Layer 0", 1] ] ]
---
B,7,A,8
B_one,6,B,7,A,8
A_one,4,A,8
One,2
Layer 0,1
What I'm not getting properly is how you use theArray, thisArray and theGroups (well... everything 🙂 ) Besides comments in code, could you please add some extra information? Thank you very much for your help, -Davide
... View more