How to list the layers of an EXR file?

What is the way to get the layers list of the an EXR file?
node_tree.nodes[‘Image’].layer gives only the name string but not the layer list.

But if I want to list all the layers to generate automatically nodes I need, how can I get this information?

Thanks :slight_smile:

If you want to list the available EXR layers from a node you can look through the outputs sockets and check to see which are enabled.


>>> node = D.scenes['Scene'].node_tree.nodes['Image']
>>> [socket.name for socket in node.outputs if socket.enabled]
['Image', 'Alpha', 'Z']

This gives the channels (Blender passes), but I’d like to do the same with the render layers.


It doesn’t seem possible. There should be something like below in the image but looking in the bpy docs there isn’t, ask on blendercoders or stack exchange I guess.


>>> node.image.layers

Ok, too bad!
Thanks for the advice, I will ask on stack exchange as soon as possible.