Disabling Paint Layers On Material Instances


Search Knowledge Base by Keyword

You are here:

The problem

Normally, textures are generated only for materials which have an appropriate Don UV node  (see material functions ) in them.

However, if you’re using a master material that is configured for painting, now all the child material instances immediately become eligible to receive paint (at a cost of one texture, per paint layer, per material instance).

Consider the standard Unreal mannequin which has a parent material M_UE4Man_Body with two material instances – one of which is M_UE4Man_Body_Inst (for the body) and the other is M_UE4Man_ChestLogo_Inst (for the chest). The chest logo is so tiny that you’ll almost never want to allow such a material to receive paint (and thus generate a texture).

 


The Solution

Fortunately, there is a simple solution for this. Open your material instance and look for a texture parameter corresponding to the UV node you placed. Eg: if you’re using Don Mesh Paint UV on Layer 0 and UV Channel 0, you’ll see a parameter named DonPaintLayer_MeshGeneric_UV0_0.

Just overwrite this parameter to any texture (like the default Black texture available in the Engine content) and it will no longer receive paint.

The plugin expects the default value for these to point to any template Render Target (which it uses to infer paint resolution, etc) and if it sees that you have overridden it to a texture, it will simply ignore the material and move on to the next one.

Here’s an example from the sample project’s “Balloon Creature”:

In the image above we are excluding only the paint layer 2 for mesh-space painting from generating paint textures. We are still interested in listening to paint layers 0 and 1 for mesh-space, or even additional layers in local/world space, all of which can operate simultaneously.

To keep your texture memory usage to a minimum it is highly recommended to go through your materials and exclude instances which have no business in receiving paint, from doing so. This is especially true for complex characters which may have several materials, not all of which you’ll want or need to paint over.