Changing materials, colors and textures
Changing how an item looks in-game
Summary
Created by @manavortex Published November 05 2022
This guide will teach you how to change an item's appearance by editing its MultilayerSetup (*.mlsetup file), how to rename materials, and how add your own mlsetups (custompathing).
It uses the following versions:
WolvenKit: 8.7.1-nightly.2022-11-06 (but anything > 8.7 will do)
MLSetupBuilder: 1.6.5 (older versions won't be compatible with WKit 8.7 and game version 1.6)
For an overview of base materials and example files, you can check here.
If your changes do not become active, you will want to install Material and Texture Override from Nexus.
Step 1: Finding your item
We will use the female variant of the puffy vest (as I've already mapped and documented it):
base\characters\garment\player_equipment\torso\t2_002_vest__puffy\t2_002_pwa_vest__puffy.mesh
Add the item to your project and open it in WolvenKit. You want the original to look up material names, even if you overwrite it with your own mesh.
Step 2: Finding the correct appearance
We will change the appearance bwstripes
, which is used by Vest_17_basic_01
:

This vest has only one chunkMask, so there's only one material.
Remember its name (ml_t2_002_ma_vest__puffy_bwstripes
) and find the corresponding material definition:
Most meshes have their materials under localMaterialBuffer/materials
. However, some of them (especially those with physics) use preloadLocalMaterialInstances
instead.

You will (hopefully) see a material with three entries in values
(order doesn't matter):
MultilayerSetup
base\characters\garment\citizen_casual\torso\t2_002_vest__puffy\textures\ml_t2_002_ma_vest__puffy_bwstripes.mlsetup
MultilayerMask
base\characters\garment\citizen_casual\torso\t2_002_vest__puffy\textures\ml_t2_002_ma_vest__puffy_default.mlmask
GlobalNormal
base\characters\garment\citizen_casual\torso\t2_002_vest__puffy\textures\t2_002_ma_vest__puffy_n01.xbm
For the purpose of this guide, all that matters is the mlsetup, which determines all the individual material assignments in this CMaterial. For an explanation of the shader, check here.

Most materials in Cyberpunk use the engine\materials\multilayered.mt
material and assign colours via an .mlsetup file. If you're used to textures, you are probably going to hate this. As somebody who has been where you are: the mlsetup system is cool. Genuinely. Give it a chance!
multilayered material
If you would rather use a textured material, check here.
A multilayered material consists of multiple layers of materials, projected on the mesh through the mlmask: white parts get affected, black parts are blocked out. (Again, for a full explanation, check here).

Exporting the .mlsetup
We're going to edit the mlsetup file and then import it back, causing a global change in the appearances of every item which uses this particular material file. (If you don't want that, see Custompathing below).
We do that by editing the MultilayerSetup:
Find the file and add it to your project.
Right-click the file and select "Convert to JSON".
Move your new json file in the same folder as the multilayer setup.

Step 3: Editing the .mlsetup file
Open up MlSetupBuilder and load your .mlsetup.json file.

If you want to see which layers correspond to which part of the mesh, you can load it from the library:

Change the colours and materials to whatever you want.
TBD: Create/link to material description
Save the file and overwrite the original .mlsetup.json
:
If you have configured MLSB and had both files in the same folders, you will see a notification when the MlSetupBuilder has overwritten your original *.mlsetup
. This takes a few seconds.
Otherwise, you need to right-click on the json file under "raw" and select "import from JSON".
This is already working. You can pack the project and see it work!

Step 4 (optional): Custompathing
If you want to put up your own .mlsetup, rather than overwriting the original one, you can do that. All you have to do is changing the DepotPaths to the relative path of your mlsetup.

Keep your folder and file names unique! If you have two mods adding a file at the same location, the second one will be unable to overwrite it and will use the first mod's file. That is, unless your mods are in REDmod format, which will be loaded even later and in order of their folder names.
Understood? No? That's fine. Just keep it unique. :D
Step 5 (optional): Renaming materials
You can rename a material by changing the "name" property inside the CMeshMaterialEntry
in the materials
array:

Inside the appearances block, the material assignment to the individual submeshes happens by name, so don't forget to change the chunkMaterial
names!
Step 6 (optional): adding new materials
To add a new material to a mesh, you need to create two entries. The first of those needs to be in the materialEntries array:

Now, add an entry in the localMaterialBuffer.

You can now use your new material just like the regular, old materials.
Last updated