Compositing an energy pulse

Hi Blenderers,

I’ve run into a compositing problem. Or perhaps it’s a ‘linked proxy’ problem.

I have a character that blasts an energy pulse around him. I’d like to render the pulse and the character as separate passes, so I can add glow to the pulse in post. The pulse is in a sphere around the character, so it’s both in front of, and behind the character at the same time. I currently have a cube as a stand in for my character. See image:


Easy enough. I create a ‘pass index’ for my character/cube, which gives me a mask to separate the elements.


My problem occurs when I replace the test cube with my character, linked from another scene. Suddenly the “pass index” no longer works. My mask turns black (although if you look really, really closely you can see tiny white speckles).


Is there a way to set a linked object’s pass index? Or is there a better way of compositing these elements I haven’t thought of yet?

I think you have to set the object id in original character file. Setting the id on linked placeholder (usually Empty) had no effect on id pass. It would be nice if it had though, overriding the id-s is useful in some situations, especially when dealing with masks.

That’s likely an option. Although not a dynamic one. It would work for this one shot, but what if I was using this character in a feature film, and in some instances needed it to have an ID of 1, and other times an ID of 2? Being able to change the ID per scene would be a very nice feature.

That said, I found an alternative solution using the Mask Layer system.
I created two render layers, the first with my character (umbreon), the second with the pulse (pulse).
On the umbreon layer, I used the scene layer with just the character.
On the pulse layer, I used the scene layer with the pulse, but also used umbreon layer as a mask layer.

[ATTACH=CONFIG]522010[/ATTACH]

This then gave me these layers (they have transparency, it’s just not showing up here):

[ATTACH=CONFIG]522014[/ATTACH]

If you look closely at the pulse you can see the slight outline of the character, which means it’s working.
When I composite these with the background layer, I get exactly what I was hoping for:

[ATTACH=CONFIG]522013[/ATTACH]

I’d strongly recommend using this system rather than the pass indexes, as the indexes often have jaggy edges and don’t composite well.

Yes, masking is a good option. I fiddled with id-s some time ago to because I wanted to use them with cryptomatte (which produces antialiased edges from id-s), but the main pain was exactly the inability to override the id of linked object. For example I have two objects linked from another scene that reference the same object. I want separate masks for them, but I didn’t find any way how to accomplish this with cryptomatte, they always have the same id value. Maybe the asset id of cryptomatte has a way to separate them but I can’t figure out what actually is an asset in blender in cryptomatte’s context.

In general, I always use distinct RenderLayer nodes to select my inputs-of-interest for compositing.