For Blender 2.81 and Cycles render.
I want to access all of the following data passes from a Python script:
Z
Normal
Vector
Object Index
Therefore, I created three Viewer Nodes with different names. See the following image:
The viewer node on the top is getting both the Z
and the Normal
passes. The one in the middle is getting the Vector
, and the one in the bottom the IndexOB
.
Now my issue is that when I use the following code pixels = bpy.data.images['Viewer Node'].pixels
, I can only access the data from the top Viewer Node (we only get the pixel data of the node that was selected from the user interface).
Is there a way that I can specify through the NameId of the Viewer Node which pixels data do I want to access?
I tried selecting and activating the different nodes through a script but apparently the data does not get automatically updated. The viewer node has to be manually clicked to make it visually active which then updates the images['Viewer Node'] data that we want to access. I found more info about this "known limitation" here.