description |
---|
Step 1: How to generate your V's custom head mesh |
Published: May 13 2023 by @manavortex
Last documented update: Dec 19 2024 by manavortex
This page is a part of the NPV guide. It will show you how to
- change the head to your V's custom head shape in Blender
- import the changed head back into Cyberpunk
This section will not deal with the following (that comes in npv-creating-a-custom-npc.md):
- Changing V's body
- Changing anything that is not the head shape (e.g. colours or materials)
If you want a 3d model, you probably know what you're doing; in that case, make sure to run the script and get the shape right, then go wild. If you want to export a body, you can still complete this guide, then follow the entity export workflow to get everything into Blender.
{% hint style="success" %} IWouldiwas Sh00kspeared made a video tutorial for visual learners (Nov 2024). You can find it on youtube, or check out the box below. {% endhint %}
- You have downloaded the prepared Wolvenkit Project from Nexus
- You have Blender installed
- You have the Wolvenkit Blender Plugin (check installing-the-wolvenkit-blender-plugin if you don't)
- Blender and the plugin are on the current compatible versions wkit-blender-plugin-current-version.md
- You have completely read this entire section
In this section, we will be moving/deleting files. You can complete these steps in Wolvenkit or in the Windows File Explorer.
{% hint style="warning" %} It's important that you leave the file structure as it is. Moving or renaming files will confuse Wolvenkit and break the example project.
The final section of npv-creating-a-custom-npc.md tells you how to safely move files. {% endhint %}
-
Open the
head
folder in your project'sarchive
section. -
Look into the
head/morphtargets
folder -
Delete all those files that you aren't using (read on as for how)
{% hint style="info" %} It's too many of them!
True! That's because I included all options for any given V. But don't worry: after you have deleted the ones that you won't be using, you should be left with a maximum of 13 .morphtarget
files for female V and 14 files for male V.
{% endhint %}
I have included all meshes and morphtargets from the game files. We'll now thin out the options, deleting those parts that your NPV won't be using.
{% hint style="success" %} The best and most convenient tool for the job is NoraLee's NPV picker. It will give you a list of files that you need to keep.
The list will give you a number of Source Mesh entries like h0_000_pwa_c__basehead.mesh
.
You need to keep these files inside the head
folder and the .morphtarget
file in the subfolder morphtargets
. If you want to understand why, keep reading; otherwise, you can proceed to Deleting Files.
{% endhint %}
What the actual fuck are all those files?
The .mesh
files are the 3d files making up your NPV's head. I've taken them from the game files and prepared them for you (by making them use the player animations and -expressions).
The .morphtarget
files are the character creator options (a direct game export). You can safely overwrite them with the most recent version by searching Wolvenkit for the file name – you need to put it into the correct folder, though, or it won't be picked up by the scripts.
We only need the .morphtargets to generate the actual meshes by duplicating the character creator process.
The different variants in the character creator correspond to the different meshes. For example, if you select cyberware 3 in the character creator, the mesh that will get loaded is cyberware_03
. Not so difficult, is it?
To learn what the prefixes mean, check #head-file-prefixes.
{% hint style="info" %} If your V isn't using any piercings, you can skip this step and go directly to Deleting Files. {% endhint %}
In the files, you will see four files for jewelry:
tutorial\npv\your_female_character\head\i1_000_pwa_c__basehead_earring_01.mesh
tutorial\npv\your_female_character\head\i1_000_pwa_c__basehead_earring_02.mesh
tutorial\npv\your_female_character\head\i1_000_pwa_c__basehead_earring_03.mesh
tutorial\npv\your_female_character\head\i1_000_pwa_c__basehead_earring_04.mesh
… none of which is your V's exact piercings. Instead, there are full sets of jewelry, most of which will be hidden.
You have to look at the meshes and find the file that includes your set of piercings. We will delete the ones you don't need later.
{% hint style="success" %} Number in file name <=> Number in character creator {% endhint %}
{% hint style="info" %} Do not delete any files if you're editing the player head (Ignore this hint if you aren't). {% endhint %}
Many of the files are variants and your V will be using one or none of them. That means you have a bunch of files to delete.
- If you have chosen the convenient option, you should already have a list of files that you need to keep.
- Otherwise, you need to refer to #what-the-actual-fuck-are-all-those-files and use the table below for some oversight.
{% hint style="warning" %}
When deleting files that you aren't using, make sure to remove both the .mesh
file in the head
folder and the .morphtarget
file in the head/morphtargets
folder.
{% endhint %}
The following table will show you examples on what to keep (as in, you delete everything else):
Body gender/variant | Files not to delete from variants |
---|---|
female V, cyberware 03 |
|
male V, scars 01 |
|
male V, big beard |
|
female V, tattoo 09 |
|
male V, no earring | Files to delete (0* means "01 - 04"):
|
After deletions, both head
and head/morphtargets
should hold only the files that your V is actually using.
For a list, see the table above.
Once you're done, you should have between 4 and 13/14 files:
minimum number of files | 4 |
maximum number of files | 13 (female body gender) 15 (male body gender) |
Now, we will export all .morphtarget
files from Wolvenkit so that we can edit them in Blender.
{% hint style="success" %} You will complete most of these steps in Blender, only the import/export happen in Wolvenkit. {% endhint %}
{% hint style="info" %} If you run into any errors, check #step-5-optional-troubleshooting {% endhint %}
-
Find the Export Tool (Tools -> Export)
- To filter, click into the empty row under "name" and write "
morphtarget
" - Check the box in the header to select everything
- Click "Export Selected"
Export all your morphtargets. Mesh files will be auto-generated for you.
- To filter, click into the empty row under "name" and write "
-
Switch to your project's
raw
folder or Wolvenkit'sraw
perspective. You will find the entire file structure mirrored there. -
In
head
folder, find the filehead_import.blend
.
This file is a utility file which will automatically import and export the files for you. For that reason, it needs to be in a certain relative path.
{% hint style="info" %}
If you have already changed your structure (by re-naming your folders), you need to make sure that head_import.blend
is in the folder head
right next to the folder morphtargets.
{% endhint %}
- Open it in Blender. It will take you to the scripting perspective, where you'll see something like this:
Looks scary, but you don't have to do anything here!
- Press the play
▶️ ▶button. - The script will now import a bunch of armatures from the
morphtargets
folder. You will see them showing up in the topright corner (see the next screenshot under 7. for how it should look) - Switch to the next script in the file, but don't run it yet:
select "01_apply_shapekeys.py" from the dropdown menu
{% hint style="info" %} If you've been previously afraid of scripting: This is a good place to stop! :)) {% endhint %}
- Find line 26 and following in the script, and alter the values to those of your V (which you get from the character preset, see here for further explanation).
{% hint style="info" %} You don't need to select the eyebrows here, as those are "painted on" later via mesh appearance. The mesh only needs to have the right shape, which is what we're doing here. {% endhint %}
- After you've changed the values to those of your V, click the "play" button again. This will apply the morphs to your V's face:
{% hint style="danger" %} Some shapekeys don't correspond 1:1 with their numbers in the character creator. If a part of V's head is shaped subtly wrong or looks weird in the game, undo your changes (Ctrl+Z), add or subtract 1 from the corresponding shape key, and run the script again. {% endhint %}
Yes, you absolutely can! Once you have completed Step 3, you can re-export the .mesh
files. Importing those into Blender will give you materials!
Now that your head looks the way you want, it's time to run the final script, which will export your changed head to .glb for you:
Select and run it
This will overwrite already existing files, leaving you with a set of import-ready mesh files.
Now it's time to get them back into Wolvenkit.
- Find the Import Tool (Tools -> Import Tool)
- Click "Import All". You shouldn't see any errors.
- You're done!
{% hint style="success" %} At this point of the guide, you should see your NPV's head in Wolvenkit (re-select the mesh to refresh the preview).
If everything works, you're done with Blender (unless you want to get fancy). {% endhint %}
If the head mesh has not changed, you ran into a problem — check the Log View and/or make sure that you completed all steps in the right order. Especially changing any paths will break things.
Spawn your NPV and check that they look like they should.
- If they don't, check #step-5-optional-troubleshooting
- If they do,
- create a full backup of your project (copy the entire folder in Windows Explorer)
- delete all
.morphtarget
files from your project — we don't need them anymore (do not delete them if you are editing the player head) - then, proceed with npv-creating-a-custom-npc.md
Optimally, this process just runs with no hitches. However, during beta testing and troubleshooting, people ran into a few issues, so I'm listing them here.
You need to use the wolvenkit-blender-io-suite for export. Make sure that it is installed and up-to-date.
You can check if Blender has run into errors by opening the Blender console window - from the menu, select Window -> Toggle System Console.
As of December 2023, any script errors have been because the person encountering them has been using the wrong Blender version. You can see which version is currently running either via UI or by checking the path in the system console window's title:
This is using Blender 2.93, which is definitely not compatible.
The supported versions are:
Check the following:
- The component's shape looks okay in Blender
- The component's shape looks okay in Wolvenkit's .mesh preview
If both of these things are true, then you can fix this problem in the next step of the tutorial, npv-creating-a-custom-npc.md.
If you had the example project lying around for a very long time, please try and redownload it (Nexus link), as the first version had been using an NPC animationgraph for facial expressions.
If that's not it, then you ran into the shapekey offset issue: some shapekeys don't correspond 1:1 with their numbers in the character creator. If a part of your shape is shaped wrong or looks weird in the game, add or subtract 1 from the corresponding shape key, and run the script again.