NPV: Preparing the head in Blender
Step 1: How to generate your V's custom head mesh
Summary
Created by @manavortex Published May 13 2023
This page is a part of the NPV guide. It will show you how to create your V's head in Blender.
Prerequisites
In this section, we will be moving/deleting files. You can complete these steps in Wolvenkit or in the Windows File Explorer.
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 tells you how to safely move files.
Step 1: Getting head
Open the
head
folder in your project'sarchive
section.Optional: Be confused and/or panic about why there are over 9000 files.
Look into the
head/morphtargets
folderOptional: Be confused and/or panic about why there are over 9000 files again.
Delete all those files that you aren't using (read on as for how)
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.
Deleting unused files: the convenient option
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.
What the actual fuck are all these files?
Meshes vs Morphtargets
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.
Okay, and all those numbers?
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?
Here's what the prefixes mean:
h0_
head (with ears)
hb_
male V only: beard
heb_
eyebrows
he_
eyes
ht_
teeth
hx_
applied on top of h0:
cyberware
makeup
freckles
pimples
tattoos
scars
l1_
ear ring (01-04)
Finding the right piercing
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 jewellery, most of which will be hidden.
You have to look at the meshes and find the file that includes your set of piercings. We'll go about hiding the excess in one of the later steps.
Deleting files
Number in file name <=> Number in character creator
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 above, you should already have a list of files that you need to keep. Otherwise, the table below should give you some oversight.
When deleting files that you aren't using, you need to remove both the .mesh
file in the head
folder and the .morphtarget
file in the head/morphtargets
folder.
The following table will show you examples on what to keep (as in, you delete everything else):
female V, cyberware 03
tutorial\npv\your_female_character\head\hx_000_pwa_c__basehead_cyberware_03.mesh
tutorial\npv\your_female_character\head\morphtargets\hx_000_pwa__morphs_cyberware_03.morphtarget
male V, scars 01
tutorial\npv\your_male_character\head\hx_000_pma_c__basehead_scars_01.mesh
tutorial\npv\your_male_character\head\morphtargets\hx_000_pma__morphs_scars_01.morphtarget
male V, big beard
tutorial\npv\your_male_character\head\hx_000_pma_c__basehead_scars_01.mesh
tutorial\npv\your_male_character\head\hb_000_pma_c__basehead_big_beard.mesh
female V, tattoo 09
tutorial\npv\your_female_character\head\hx_000_pwa_c__basehead_tattoo_09.mesh
tutorial\npv\your_female_character\head\morphtargets\hx_000_pwa__morphs_tattoo_09.morphtarget
male V, no earring
Files to delete (0* means "01 - 04"):
tutorial\npv\your_male_character\head\i1_000_pma_c__basehead_earring_0*.mesh
tutorial\npv\your_male_character\head\morphtargets\i1_000_pma__morphs_earring_0*.morphtarget
Expected result
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 this many files:
minimum number of files
4
maximum number of files
13 (female body gender)
14 (male body gender)
Step 2: Exporting head
Now, we will export all .morphtarget files from Wolvenkit so that we can edit them in Blender. You will complete most of these steps in Blender, only the import/export happen in Wolvenkit.
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.
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.
Open it in Blender. It will take you to the scripting perspective, where you'll see something like this:

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:

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).

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:

Some shapekeys don't correspond 1:1 with their numbers in the character creator. If a part of your shape 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.
Step 3: Importing head
Exporting from Blender
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:

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're done!
You can now start the game and look at your V's face to make sure that your head and eyes are showing up correctly . If it does, read on how to hook up stuff for the game files. Otherwise, keep reading.
Can I have that with textures?
Yes, you absolutely can! Once you have imported them back into Wolvenkit, you can use the With Materials option and the Wolvenkit Blender Plugin to get a fully textured and shaded set.
Step 4: Troubleshooting
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.
Blender import errors
If you get an error within Blender, e.g. something like AttributeError: 'NoneType' object has no attribute 'name'
, then something is wrong with your Blender install or you are using the wrong version. Reminder: This has been tested with 3.5.1, but anything >= 3.4 should work.
The piercings are in the wrong position!
The problem went away after the person having it upgraded Blender to 3.5.
V was imported, but the textures are all wrong!
This happens when the UV maps are flipped. 8.9 doesn't implement that feature yet, so you might have to use a more recent version of Wolvenkit — the Nightly from 2023-04-29 is currently stable.
Alternatively, you can use the last script in the file, which will attempt to flip the UV maps for you. It might have an offset, though.
V was imported, but they're unsettlingly, subtly wrong
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: ssome shapekeys don't correspond 1:1 with their numbers in the character creator. If a part of your shape is shaped subtly wrong or looks weird in the game, add or subtract 1 from the corresponding shape key, and run the script again.
Last updated