description |
---|
How to change V's head |
Published: September 30 2023 by manavortex
Last documented edit: Oct 20 2024 by manavortex
This guide will teach you how to edit the player head to create custom head shapes. You don't need to understand the complex parts of the process, as long as you follow the instructions to the letter.
{% hint style="info" %} If you want to edit other files for V, you may be able to find their paths in cheat-sheet-body.md or one of the surrounding pages. {% endhint %}
- You have Blender installed
- You have a Wolvenkit project
- You have the wolvenkit-blender-io-suite installed and ready to go
{% hint style="info" %} This guide assumes that you'll be starting from 0. If you want to use character creator options, please reference the npv-preparing-the-head-in-blender.md to the point where you apply all shapekeys. {% endhint %}
{% hint style="info" %} You can consult cheat-sheet-head-> #head-file-paths for more information about head files. This is not necessary for the scope of this guide. {% endhint %}
- Add all morphtarget files for your body gender to your Wolvenkit project:
body gender | Asset Browser search query |
---|---|
fem | base\characters\head\player_base_heads\player_female_average > .morphtarget |
masc | base\characters\head\player_base_heads\player_man_average > .morptharget |
{% hint style="danger" %} Make sure to include all morphtargets in the folder: cyberware, tattoos, scars, and for mascV, beards. {% endhint %}
- Export them all via Wolvenkit Export Tool (you can find step-by-step instructions in the NPV guide under #step-2-exporting-head)
- Use the wolvenkit-blender-io-suite to import all of your
morphtarget.glb
files. Make sure to un-checkWith Materials
in the right sidebar - we won't need them, and they'll only slow down the import process.
- If there is a collection with the name
glTF_not_exported
, collapse or delete it - we don't need all those things.
If you have applied shapekeys
If you come from the NPV guide and have used the script to apply character creator presets, you have lost all shapekeys and need to restore them.
For all armatures (collections) in your blend file, do the following:
-
Import the
.morphtarget.glb
again. This will create a collection with the same name and the.001
suffix: -
For each mesh in the collection, repeat the following steps:
- Select it
- Switch to Edit Mode (Hotkey:
Tab
) - Select all vertices (Hotkey:
A
) and delete them (Hotkey:X
) - Switch back to Object Mode (Hotkey:
Tab
) - Select the empty mesh, then (Ctrl+click) the corresponding mesh without shapekeys
- Join into the empty mesh (Hotkey:
Ctrl+J
). You now have a re-shaped mesh with shapekeys.
You now have between 32 (femV) and 45 (mascV) collections in Blender. That's a lot of resculpting! Fortunately, we don't have to do everything by hand.
We'll make use of Blender's modifiers, specifically Surface Deform
, to do the heavy lifting for us. For that purpose, we'll use a dedicated sculpting mesh, and make everything else take its shape.
- In the Outliner at the top right of your viewport, find the collection with the name of
h0_000_pXa__morphs.morphtarget
(x being w or m) and expand it. - Find the mesh starting with submesh_00_LOD_1 (it can have a suffix like .001), and select it by clicking on it
- Duplicate it (Hotkey:
Shift+D
,ESC
) - Rename your duplicate to e.g.
sculptme
. This is the mesh we'll be editing. - Select sculptme, then switch to the
Data
tab ofProperties
(at the bottom right of your viewport), and disableShape Key Edit Mode
:
Now, we're ready to hook up the magic.
Each mesh in your .blend file needs a Surface Deform
modifier that binds it to sculptme
. Fortunately, you don't have to do that by hand!
{% hint style="warning" %}
Make sure that sculptme
is still selected in the Outliner - the script will target the wrong mesh if it isn't.
{% endhint %}
- The script you need is add_surface_deform.py from mana's github.
- Follow the blender-running-python-scripts.md guide with that script, then come back here.
- After clicking play, all meshes but
sculptme
will now have asurface deform
modifier:
This modifier will deform all your meshes together with sculptme
.
- You can now hide all collections that you don't want to see in the Outliner.
- I usually only keep
sculptme
, eyes, and eyebrows visible (hiding the original head mesh)
This is the part where you draw the rest of the owl.
{% hint style="info" %} Save your .blend file before you start with this. In fact, save it twice. You can thank me later. {% endhint %}
You can use the sculpt mode to change the shape of sculptme
until you're satisfied.
This guide won't go into details (yet), except to tell you that the Elastic Deform
tool is your best friend here. Check mesh-sculpting-techniques for tips and tricks how to go about this.
{% hint style="danger" %} As of October 2024, Wolvenkit may run into issues exporting edited morphtargets, so make sure to hang onto your .blend file! {% endhint %}
{% hint style="info" %} This is an excellent time for a save, because the script will remove the surface deform modifiers. {% endhint %}
Before you can export your sculpt, you need to apply the surface deform modifiers, because Wolvenkit (and Cyberpunk) will flat-out ignore them.
Fortunately, you can do this by script as well.
- Find apply_surface_deform.py on mana's github
- Follow the blender-running-python-scripts.md guide with that script, then come back here.
- After clicking the play button, the Surface Deform modifier will now be gone, and your mesh will have changed shape for good.
You can now export the morphtargets.
-
For each armature, select all submeshes inside
-
Use the wolvenkit-blender-io-suite's default settings and overwrite the corresponding
.morphtarget.glb
-
Import the files back into Wolvenkit via Import Tool. This should simply work! If it does not, you might have to overwrite the mesh file as well - see the morphtargets page for instructions.
If everything has worked, you should now be able to create a new V with your new head shape. (Loading into an existing V might cause crashes)
Otherwise, the right place to ask for help is #mod-dev-chat
on the redmodding Discord server.
Happy modding!
By turning off character creator slides, you can stop Cyberpunk from crashing.
{% hint style="info" %} As of 8.15, this will break Wolvenkit export. Before exporting, you need to set the numTargets back to what WKit expects it to be. {% endhint %}
For each .morphtarget
, you can change this value to 0:
If you get an exception about blob.header.numTargets
: check #step-6-optional-disabling-the-character-creator.
Otherwise: Known issue as of Wolvenkit 8.15 - future Wolvenkit versions will fix this. It's why you were supposed to hang on to that .blend for dear life. :)
A known risk of custom heads, because custom cyberware/beards/tattoos won't play nice with this. See #step-6-optional-disabling-the-character-creator for an (admittedly heavy-handed) solution.