How to automatically add object to Matte objects? Right now I have to use Pick output of Cryptomatte and then use eyedropper to add all the objects I need.

Ideally, I would like to have a mapping: object -> color

enter image description here


I think the best way to do this is to open up a text editor window in blender by putting your mouse on the corner of the 3d view and dragging to open it. This will open up another window and you can change the window type to text editor. Click new and you will have opened up a file. Next open up a python info window using the same procedure. You can now see what all your commands are in python. You can add objects like this by typing this into the text editor:

for i in range(10):

replace stuff with the commands that you see printed in the info tab that you used to create your shape. For example, once you make a cube you see a command in the info tab called bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False, location=(0, 0, 0)). You could then copy that command into your code to create your shapes. If you want to learn about python scripting I would recommend reading blender's python documentation.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.