Changing materials, colors and textures

Changing how an item looks in-game

Summary

Published: November 05 2022 by manavortex Last documented edit: Jun 29 by manavortex

This guide will teach you how to edit an item's material, changing its appearance.

Wait, this is not what I want!

Prerequisites

Overview

Estimated time

For a complete noob, including setup of the tool(s): ~1h Once you know what you're doing: <5 minutes and as much time for fine tuning as you want

Steps

This guide will take you through the following steps:

Video guide

Please keep in mind that video guides might be outdated, as they are much more difficult to update than a wiki page. Refer to the written guide below if you run into any troubles!

Step 0: Finding the .mesh and the appearance

Estimated time: ~5 minutes for total noobs, unless you get side-tracked badly

This process is detailed under Spawn Codes (BaseIDs/Hashes) -> Step by step.

  1. Find the item's mesh file path and appearance. You should end up with something like this:

    • base\characters\garment\player_equipment\torso\t2_002_vest__puffy\t2_002_pwa_vest__puffy.mesh

    • bwstripes

  2. Find your mesh in the Asset Browser

  3. Add it to your Wolvenkit Project (double-click or right-click -> Add to Project)

Step 1: Finding the correct material name

To learn how appearances and materials connect, you can read 3d objects: .mesh files. This is not necessary for the purpose of this guide.

  1. Open your mesh file in Wolvenkit by double-clicking it.

  2. Find the array appearances at the very top, and expand it.

  3. Find the appearance by the name that you found in Step 0 (example: bwstripes), and expand it

  4. Find the chunk material names. These define the material:

  1. Starting with Wolvenkit 8.15, you can right-click on a chunk and click on "Select Material" from the context menu. For earlier versions, you have to find the material yourself - proceed to the next step.

Wait, I don't know which material I'm supposed to edit!

If you don't know which submesh is the right one, click on "Mesh Preview" next to the red CMesh button, directly above the editor. This will take you to the preview tab, where you can switch chunks off and on by checking the corresponding box.

Step 2: Finding the material instance

Depending on your mesh, the material instance will be in one of two places: either under localMaterialBuffer.materials, or under preloadLocalMaterialInstances.

(If you don't see preloadLocalMaterialInstances, that means it's empty and has been hidden.)

Inside the array, find your material by name:

If you see multilayered.mt as the baseMaterial, you have to edit this with MLSetupBuilder. Fortunately, it's not very difficult.

If you'd rather use a textured material, see the Using a textured material sub-page.

Most materials in Cyberpunk use multilayered.mt as base material — this is how everything looks so good without 100 GB of extra textures. It's slightly more complex than editing textures because you need an extra tool, but you will love it once you're over the worst shock.

Step 4: Changing the material properties

You will (hopefully) see a material with three entries in values (order doesn't matter):

KeyValue (DepotPath)

base\characters\garment\citizen_casual\torso\t2_002_vest__puffy\textures\ml_t2_002_ma_vest__puffy_bwstripes.mlsetup

base\characters\garment\citizen_casual\torso\t2_002_vest__puffy\textures\ml_t2_002_ma_vest__puffy_default.mlmask

base\characters\garment\citizen_casual\torso\t2_002_vest__puffy\textures\t2_002_ma_vest__puffy_n01.xbm

Do you want to know more?

In this guide, we'll focus on editing the MultilayerSetup.

Exporting the .mlsetup

First, add the .mlsetup to your project. You can either expand the CKeyValuePair and click the yellow button, or copy the depot path and use the Asset Browser.

Step 3: Editing the .mlsetup file

If you don't have MLSetupBuilder installed, you need to do that now. If you don't know how to use it, please check Using MLSB

Optional: by hand

Open up MlSetupBuilder and load your .mlsetup.json file.

If you select WolvenKit's "Open in File Explorer" option, you can copy the path from the explorer's address bar and paste it into the MlSetupBuilder's address bar.

For a documentation of multilayer properties, see here. For a list of reference images, check Multilayered: Previews

  1. Export the file, overwriting the original .mlsetup.json

  2. Switch back to Wolvenkit

  3. Right-click on the .mlsetup.json and import it from json.

This is already working. You can pack the project and see it in action!

If it doesn't work, you need to install Material and Texture Override from Nexus.

Step 4: Being done

Congratulations! You modded an item! If that's all you wanted, you can now go and do whatever you want. You can even delete the mesh from your mod and pack only the .mlsetup!

Of course you have only changed an in-game texture, which may cause side effects — especially if other mods do the same. To change that, keep reading!

Step 5: Custompathing

Instead of changing an in-game file, you can also replace it with your own.

  1. Rename your file to something nobody else will touch, e.g. manavortex\mlsetups\my_custom_vest_appearance.mlsetup

  2. Copy the new relative path (right-click), and update your mesh:

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 6: Renaming materials

You can rename a material by changing the "name" property inside the CMeshMaterialEntry in the materials array:

As of Wolvenkit 8.15, chunkmaterials will not auto-update, but you can use Search and Replace from the Context Menu to rename everything at once.

Step 6 (optional): adding new materials

To add a new material to a mesh, you can simply right-click on the materials array:

Consider converting your mod to use ArchiveXL: Patching appearancesfor much better compatibility and smaller mod size!

By hand

First, create a new entry in MaterialEntries by duplicating the latest item as a new entry:

Change its name to something unique.

Now, add an entry in the localMaterialBuffer.materials (or preloadLocalMaterialInstances):

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

Last updated