When a plane is emitting bricks using geometry nodes, how do I add the resulting brick wall to a cryptomatte pass?
I tried adding the emitting plane, that only works if I “realize instances” in the nodes, which often tanks performance. Or if I add each brick object to the crypto selection separately, but that doesn’t work if you aso use the bricks in another geonodes setup…
Geonode’s instances is still a single object in a blender scene. So cryptomatte gives a single matte if you using object separation in it. But there is a second type of matte separation based on materials. You can create a dummy material and assign it to your instances. And then choose separation via materials in cryptomatte and it will work.
So, no, that’s the opposite of what I’m seeing. The instances generated by GeoNodes are all separate objects that I need to pick separately. Each brick in a generated wall can be picked as “brick 01” or “brick 02”, which are the sources of the geoNodes setup…
No, each instance in the setup can be picked as the source object that it was before the nodes. So if I spread 2 types of AC units on a roof and those ACs had a parent, I can pick those 2 parents separately. But I can’t pick “all ACs” generated by geoNodes unless I realize instances.
I don’t think it would work to add a new material to the GN source objects, because that material would not be assigned to any polys.
I wasn’t looking for a workaround, I just wanted all of the geometry of geoNodes to be assigned to a single selectable object in cryptomattes. If realize instances is the way to do that, I will.
If you assign a material to all the instances in the geometry nodes node tree then the cryptomatte node will pick up all the instances with that material
No, because the materials used in the scattered objects are often used in other geoNodes setups. If ai need a crypto for trees_close and another for trees_far, that doesn’t work.
I often generate up to 10 crypto’s for better comping later on.
Ok, in your case I’d personally separate the scene in view layers, that would be the easiest solution IMO.
But if you still want to use cryptomatte to not have to setup view layers I think using CryptoAsset would work better than Material/Object.
Parent the instance objects to an Empty (or any other object) and then the cryptomatte node will recognize anything parented to that object as the same thing, including the instances created with GN
This still doesn’t work in a real scene. If I have 3 tree objects and I scatter them on a foreground plane and a background plane, I still can’t generate a cryptomatte from the plane emitting the foreground trees. Because if I pick the parent of the 3 tree objects in the scene as you suggest, the crypto will contain both tree emitters.
I often use geoNodes in modelling: I have 10 bricks, 4 concrete planes and 5 wood beams. I build several buildings in the scene with those. But I need a cryptomatte for the GN emitting the base objects. I think CryptoMatte in Blender should have an option to pick all of the instances emitted by geoNodes with 1 pick, without having to realize instances.
Same here! Ooooh, collection cryptos… In some scene I have to many items parented to nulls for no reason just to be able to pick the parent in compositing…
Right, we often do something similar at work, and use collection instances for some stuff to be able to select them as a single object later, fortunately in our case the amount of individual masks we need is very low.
I’ve been rendering some posters of huge scenes, need lots of masks to make the final composit in post. The water in the image below had a very complex ocean shader for instance, was easier to comp the EXR layers in Affinity for just the water than to hack the shader