0

As I tried to reproduce this code: How to find all image coordinates of rendered object?

I encountered an error:

KeyError: 'bpy_prop_collection[key]: key "View Layer" not found'

All objects are in a collection, so was is the problem?

  • bpy.context.scene.view_layers['ViewLayer'].use_pass_object_index = True or bpy.context.view_layer.use_pass_object_index = True should do...? – pyCod3R Feb 12 '22 at 12:22
  • ... updated the code for 2.8+: https://blender.stackexchange.com/a/166221/ – pyCod3R Feb 13 '22 at 08:05

0 Answers0