How to make a custom MultilayerMask for your mesh
Created & Published: April 12 2023 by @manavortex
This tutorial will teach you how to create your own MultilayerMask for an item and then assign an own MultilayerSetup to it.
Difficulty: You know how to read.
Start by adding any .mlmask file to your WKit project. It doesn't matter which one, but you can start with this (6 white layers):
Then, export it via the Export Tool.
This will give you the following file structure:
Add the mesh that's supposed to hold your material to your project and export it.
Import it into Blender and select the Texture Paint perspective.
Switch into Edit Mode
Select those parts of the mesh that you want to color.
Duplicate them (Ctrl +D, ESC) and split off a new submesh (P -> Split Selection).
Switch back into Object Mode.
Select the new submesh; hide the old one.
Create a new image. It can be 512x512 for now; only upscale if you find that you can't get it un-pixelated in-game. Most CDPR layer masks are really low resolution!
Switch the right viewport into "Texture Paint"
Find the "Texture Slots" dropdown in the menu (you may have to scroll)
Set Mode
to Single Image
Select your new black image from the list below.
In either of the panels, set your brush foreground color to white (or gray). This determines the transparency of the layer. I recommend that you use white and regulate transparency via mlsetup, but if you want to paint e.g. clothing folds or wear&tear, you might want to paint greyscale.
Optional: Set these properties under "Options":
Paint!
Rinse and repeat until all parts of your mesh that should have your material are white on the left-hand image.
Now for the annoying part: On the right side, make sure the mask is more or less smooth, as you will see this in-game.
Now, save the image: overwrite one of the layers from the mlmask that you have exported. If you run out of layers, you can just add them at the end.
The game assumes that layer 1 is white, so start exporting over layers >0
Do this as often as necessary.
Once you're done, open the masklisk and make sure that you have exactly as many entries as you have images in your folder (adding or deleting them as needed). Then, in Wolvenkit, import the masklist via Import Tool.
All images in the multilayer mask need to have the same resolution. Otherwise, it will crash your game.
You can now assign your new Masklisk to your mesh and use it together with custom MultilayerSetups.