This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Parent index for PSD layers

Hi,

Is there a convenient way to determine the index of a PSD layer's parent layer?

For instance, the root layer would have parent index -1, children of the root would have parent index 0, etc, as follows:

 0
 |
 +-1
 |
 +-2
 |  |  
 |  +-3
 |  |
 |  +-4
 |
 +-5


Layer 0, parent = -1.
Layer 1, parent = 0.
Layer 2, parent = 0.
Layer 3, parent = 2.
Layer 4, parent = 2.
Layer 5, parent = 0.

I need this information to reconstruct the layer tree in a calling application.

Thanks,
Cameron
Hello Cameron,

Unfortunately Advanced PSD Add-on doesn't extract layers tree information. PSD content is accessible just as a plain list of layers. If you have control over the source PSD file you can encode tree structure information into the names of the layers for later reconstruction. But for arbitrary input files there is no way to reconstruct the layers tree.