Dear GOD is there a simple way to render ID passes in Blender yet?

I’ve been searching this topic since I first picked up Blender a year ago.

I need a simple way to do this:

Y’know, the thing that every other 3d package has been able to do since the dawn of man.

I know Blender has Object IDs, but that’s all I know, and every discussion I find on the subject is from ten years ago. I’ve pretty much seen every youtube video on the subject and they either don’t explain things very well or it’s not quite what I’m looking for.

Been struggling with this on a daily basis now. I mean, not even an add-on? There have been feature length movie made using Blender, and what, they just cut everything out by hand with a lasso?

1 Like

Hi,
Is cryptomatte not a solution for you?
It’s not that hard with Object IDs but the result is terrible (aliassing issue).
But the best could be using emission. There is an addon for that but then I have to do a long search. His name sound like Martin, Martineirs, or eh, I forgot Martin Zeijs and he never bragged about it, but was pretty handy. Not sure thought if it still works in latest blender versions. I think I would go for cryptomatte then.

4 Likes

Hey man, here’s a simple workaround I use every day:

Enable Workbench for rendering
Lighting > Flat
Color > Random
Under color management enable Use Curves. Grab a point in the middle and drag it down towards the bottom (curve changes from a / shape to a _/ you’ll have to play with it for a sec)
Be sure to disable the use curves after rendering. It will remain even after switching back to cycles or eevee.

1 Like

Hey, @wonderland78! Not to derail your question, but so I can understand a bit better what you need, what do you use the Render ID pass for?

@robl the random feature is terrible except by accident, when the same colors DON’T overlap. Why is there zero control over the randomness? why can’t we at least have a seed we can cycle through, and why are all the colors so weak and samey? really annoys me.

@Hunkadoodle - I’m just trying to get a render pass where objects and/or textures have a solid color so I can select them in photoshop later.

@anon72338821 - I think maybe Cryptomatte is the closest thing but it’s so complicated I can’t figure out how to make it work. The ideal for me would be a little number assigned to each collection. And each number has a unique color. It’s so easy to do in every other 3d software.
I tried to look up that Martin guy and all I found in google search results was this thread :stuck_out_tongue:

1 Like

You can make random color shader in cycles and add it as material override for view layer:

6 Likes

I found him, it’s @MartinZ https://blenderartists.org/u/martinz/activity/portfolio
He made once an addon that worked better than Object_ID, and maybe even better than cryptomatte.

But cryptomatte is not that difficult once you know it. I bet there is a tutorial for it. For example here: https://www.youtube.com/watch?v=VBJQM-gIob8

But I see now @Format64 solution and looks hilarious easy. I think you try that first.

I’m not laughing :cry:. @Format64, would you mind explaining further? Especially the part about Material Override. This is what I’m seeing.

You have your Saturation and Value inputs in HSV Combine node set to 0, change it to 1

Material override is here (cycles only):

2 Likes

I swear I checked and rechecked those settings! Thanks for confirming I’m a moron. :rofl:

Works as advertised. Thanks a bunch! :heart:

2 Likes

Now that I’ve gotten the settings right :laughing: I don’t think this would solve @wonderland78’s problem, as @anon72338821 suggested, as the Random out from the ObjectInfo node doesn’t put out enough random colors as in the following example.

Notice the two mauve(?) blocks in the center right. While all the rest of the blocks and floor are different enough to wand select in Photoshop/Affinity/GIMP, those two become one selection…or am I missing something again?

@anon72338821’s suggestion of learning Cryptomatte is most likely the best solution. It’s not that hard (even a moron like me got the hang of it :smile:) and you don’t have to mess with double materials.

Oh, and thanks to @EAW for liking that I’m a moron. :rofl:

Yes, exactly as people said above. The proper workflow is to create a simple ID material as @Format64 posted and then create a new view layer, label it ID pass and assign that material as an override. That way, you have non destructive, secondary view layer, and you can then render it at once with your beauty pass. View layers essentially are render passes in Blender.

Ok, could someone walk me through this? I’ve looked at the above steps, and the cryptomatte tutorial but I get as far as this. I hit render but my viewer node still looks blank. In the tutorial they said you just have to render and you get access to all this information… ? This is what it looks like after I render.

Try cycling through it a few times by ctrl+shift+click on the cryptomatte node. This should change which output is connected to the viewer node.

  • Connect “Pick” to the viewer node
  • Press the “Add” button
  • A color picker icon appears and you can select which object(s) you want to use for your mattes
  • Connect “Matte” to the viewer node to see your matte.

edit: Ah, and it appears that the “backdrop” button in the top left is unpressed. Press it.

Ok cool, the Backdrop button was the key.

Just a couple of questions. Firstly, the image (although I rendered low res at around 1000px wide just to save time) is extremely aliased. Is there an option for that?

Also would be ideal to be able to pick not just objects to make white (using the matte option) but to set the color of objects/groups of objects in the ‘pick’ view. Do I have control over that?

I was liking that you said thanks :yum:

If H separation gives identical colors, try a 1D White Noise instead. Instead of yellow, you might get oranges and browns with different saturation levels - more color outputs than what just the hue provides.

I am not sure what you mean? Can you rephrase?

I don’t think you can chose whole collections. You can chose single objecst, all objects with the same material or “assets”. Assets are all objects that parented to an object.
I think collection instances and linked collections and things like that are assets as well.

It is worth reading the manual:
https://docs.blender.org/manual/en/2.90/render/layers/passes.html?highlight=cryptomatte

https://docs.blender.org/manual/en/2.90/compositing/types/matte/cryptomatte.html?highlight=cryptomatte

Ok, so the cryptomatte is a joke so I’m not pursuing that option any more. If I have a bunch of objects that I’m trying to make a mask out of, and those objects are numerous (like a shelf full of books) I can’t just eye-dropper pick each object. And I can’t be going around parenting everything into one object, which I then need to unparent if I want to make changes to the scene.

There really just needs to be a way to check ‘object ID’ in the render passes and give every object an ID (and it would be amazing to attach IDs to collections), and when you hit render, it assigns a fixed color per ID number i.e. not random - so YOU have control over the cols to avoid duplicates.

All I can suggest, as a quick temporary fix until the Blender team get their finger out, is this:

As mentioned above. So we now have THREE whole different ways of generating random cols and we just have to hope that by giving it three shots, we can avoid the dreaded ‘magenta overlap’ which, for reasons unknown, plagues Blender’s random color algorithm.

Random 1 - HSV
Random 2 - White Noise Texture set to 1D
Random 3 - Workbench render set to flat and random

I also don’t understand why option 3 above has to be completely un-adjustable. There should be a field with ‘seed’ written on it, and you click next, next, next until you get a random palette with no overlap. Or you just generate a few different ones to bring into Photoshop and each has SOME overlap but between them you get the masks you want.

I feel like long time Blender users just don’t know how frustrating it is to have this feature be implemented as standard in other software for years. Considering how many dozens of crazy new features keep getting brought in, it surely wouldn’t take more than a day or two for the developers to sort this out.

Of course the other hack is to put objects into collections and hide everything BUT that collection and render it as workbench/flat/white etc. but that still does not do the job e.g. if I have grass growing through the ground and I hide the ground, I won’t have a mask for the grass that’s protruding.

Wish there was a way I could get hold of someone in the dev team to tell them how important this issue is.