'CustomDepth Stencil Value' defined to sub-components of an asset (in UE 5.3)

Hi UE gurus,

I have a vineyard asset composed of different parts i.e. the leaves of the vine (with its material instance and associated texture) and the rest i.e. trunks, grapes, poles, etc. (with its material instance and associated texture). I would like to specify a ‘CustomDepth Stencil Value’ of ‘1’ only for the leaves, but not for the rest.

Currently, I’m only able to define a ‘CustomDepth Stencil Value’ at the level of the whole asset, which is insufficient for the detection of the vine leaves required in an autonomous drone application. For an accurate recognition, I need the ability to assign different ‘Stencil Values’ to specific sub-components or materials within the asset.

Would this be possible? Any guidance on how to proceed?

Greetings @Tacchino_Atomico

Welcome to the Unreal Forum! If all of the parts are one mesh, the best way to resolve it would likely be to go into a 3D modeling tool like Blender, separate them into different meshes, and then import them into UE.