1

In Blender 2.79 I'm trying to access the different layers which are present in my MultilayerEXR files using Python. Basically, in my Node Editor, I have an Image node which offers me the various layers which are present in the file:

Example

I can call the name of the layer just fine using bpy.context.scene.node_tree.nodes.active.layer, which will output 'Base' in this example.

Now, following other examples here on this site, usually I can get the possible Enum Items using bpy.context.scene.node_tree.nodes.active.bl_rna.properties['layer'].enum_items. While this does return an Enum to me, it is always the same one: It will be <bpy_collection[1], EnumProperty.enum_items> in all cases. Calling the following:

bpy.context.scene.node_tree.nodes.active.bl_rna.properties['layer'].enum_items[0]

will always return

<bpy_struct, EnumPropertyItem("PLACEHOLDER")>

How can I retrieve the list of layers which is stored in the image?

aliasguru
  • 11,231
  • 2
  • 35
  • 72
  • I'd imagine the placeholder is the internal item "dummy" for a dynamic enum, which is filled once an image is selected for the node, as the layer names are within the image data. Would need to get the layer names from the image – batFINGER Nov 03 '17 at 16:51
  • @batFINGER Makes sense. I was hoping that even if it was a dynamic Enum, it would be exposed in Python already. It has to be around somewhere, as it's drawn in the UI. Will follow the OpenEXR header path for a start, thanks :) – aliasguru Nov 03 '17 at 17:29

0 Answers0