
Notes for hair editing (material properties color and texturing)
-
Endorsements
-
Unique DLs126
-
Total DLs143
-
Total views14,168
-
Version-
39 comments
Hair textures don't load / have no transparency
To do that, you need WolvenKit (any version) and a cooked mesh to edit.
> import and cook your mesh using any software you like
> copy it's .w2mesh AND .w2mesh.buffer files from Cooked directory
> create a mod project in WolvenKit
> add folder structure leading to your mesh in Cooked directory (WolvenKit v0.7+) or Bundle directory (WolvenKit v0.6 and older)
> paste .w2mesh and .w2mesh.buffer
> open .w2mesh file and, in MaterialInstance, tick "EnableMask" flag (WolvenKit v0.7+) or find a source to copy the flag from and past it to your mesh (WolvenKit v0.6 and older); for source w2mesh, use any vanilla hair or lace mesh; make sure the file tree looks similar to vanilla mesh;
> save the file, pack and install your mod. Enjoy!
How it should look for
WolvenKit v0.6 and older
WolvenKit v0.7
Hair mesh is moving weirdly, is stretched at all times or has missing parts of a mesh
It's most likely due to Weight Paint issues or rig/skeleton/armature issues.
Some parts of a hairstyle are missing in game:
> click on your armature and select Pose Mod
> select all the bones of your armature
> move it around
If some parts of your mesh are not moving along the armature and are stretching instead, you should adjust Weight Paints on those areas.
Weird movement/stretching in game:
Make sure you are using corresponding vanilla armature in your mesh and dyngset in your hairstyle's w2ent.
Combining two or more hairstyles/pieces together using two or more dyngsets:
pros: looks great, flies around pretty, is pleasant to look at
cons: tiresome to make it work
To do that, you would have to combine your hairstyle of two or more independent meshes with own armatures linked each to own dyngset, and then enable both meshes on a character in game at the same time. Practically, we have to make character to wear two or more hairstyles at the same time.
Modelling workflow:
> find source dyngsets in game (Geralt's Doppler is great for such research)
> find hairstyle meshes using those dyngsets
> import the source meshes to 3d software
> combine, model and edit your hairstyle
! do not try to add bones to vanilla armature, do not try to merge armatures, it only leads to game crashes;
! keep mesh parts related to different armatures separated, so that you can keep track of weight paint;
> export each part's mesh from blender to fbx, one mesh & armature per fbx
> assign material to it in an .xml file
> import & cook your mesh
How to enable both or more parts in game:
There is two ways of doing it: first way is of having two independent items forming one hairstyle enabled on an actor at the same time;
second: of having an item with 2 or more dyngsets and two or more mesh component, so that you can replace vanilla hair item with it, for example;
Explanation of a first method:
part 1 of a hairstyle:
item w2ent: characters\models\main_npc\triss\c_01_wa__triss.w2ent
has selected dyngset: characters\models\main_npc\triss\h_01_wa__triss\c_01_wa__triss.w3dyng
and mesh: characters\models\main_npc\triss\h_01_wa__triss\c_01_wa__triss.w2mesh
part 2 of a hairstyle:
item w2ent: characters\models\main_npc\yennefer\c_01_wa__yennefer.w2ent
dyngset: characters\models\main_npc\yennefer\h_01_wa__yennefer\c_03_wa__yennefer_dyng.w3dyng
mesh: characters\models\main_npc\yennefer\h_01_wa__yennefer\c_01_wa__yennefer.w2mesh
actor's w2ent: characters\npc_entities\main_npc\yennefer.w2ent
has an appearance "yennefer_gown"
which consists of: torso
head
pendant
part 1 of a hairstyle: characters\models\main_npc\triss\c_01_wa__triss.w2ent
part 2 of a hairstyle: characters\models\main_npc\yennefer\c_01_wa__yennefer.w2ent
screenshot
this is easy to make, but the packed mod would be incompatible with any other mod editing the same actor's entity in any way.
Alternatively, you can make a DLC that only edits one appearance slot, so that it would actually be compatible with other mods besides the appearance(s) you've edited;
Explanation of a second method:
you should either find an item entity that has 2 or more dyngsets attached to it, or you have to make one yourself. At this point in time, even the latest public versions of WolvenKit are very buggy and so making such entity from scratch can be a nightmare. You can always borrow some vanilla one and change paths though! For example, Anarietta's traveling torso has two dyngset slots:
So I can copy this w2ent, disable all the mesh components (by leaving mesh paths empty/leading nowhere OR by deleting them from w2ent entirely), but those connected to CAnimDagnleComponents as I plan to use them, and to update dyngset and w2meshes paths to my mesh parts.
It would roughly look like so:
item w2ent: dlc\bob\data\characters\models\main_npc\anna_henrietta\body_03_wa__anna_henrietta_travel.w2ent
dyngset 1: characters\models\main_npc\triss\h_01_wa__triss\c_01_wa__triss.w3dyng
mesh 1: characters\models\main_npc\triss\h_01_wa__triss\c_01_wa__triss.w2mesh
dyngset 2: characters\models\main_npc\yennefer\h_01_wa__yennefer\c_03_wa__yennefer_dyng.w3dyng
mesh 2: characters\models\main_npc\yennefer\h_01_wa__yennefer\c_01_wa__yennefer.w2mesh
When done, rename and either replace vanilla hair w2ent for the character you need, or edit appearance like in the first method inheriting the same compatibility issues.
First of all thanks for the tips.
I did a basic npc hair swap for triss and I'm getting the weird movement you mention in the FAQ. I understand why it's happening but I don't know what you mean by "in game rig for hanging/dangling objects -- dyngset". What software are you using on that screenshot? I exported the entire Triss model folder but didn't found the file you are highlighting in there. Thanks.
edit: I figured it out, thanks anyway!I've saved it and the changes show up in REDkit but once I publish the mod & load in its the exact same as the default.
I'm still on 3.3.0 but the latest stable version of blender is now 3.4.1...I'm not sure for exactly how long, but it has native FBX import.
- Is this sufficient? Or do we still need to use an older version of Blender along with KoalaNalle's 2.76 plugin to import FBX and then save it and bring it into newer versions of blender? There are no options given at the time you choose which FBX file to import in 3.3+, but it appears that normals are automatically imported anyway.
Any suggestions/advices to start?
TY!
My problem is that I can edit the mesh, and create a mod that shows my edited mesh, but the hair is completely detached from Geralt in the game and stays in one spot. I am obviously not importing or exporting to/from Blender properly. Any ideas?
I see you've linked to a tutorial on this (https://www.nexusmods.com/witcher3/mods/3498) but that link seems to have disappeared. Is there any other way to get this old tutorial?
Yeah, Jato left Nexus, and so his beautiful resources are gone 3:
Still, there is a link to a Blender 2.92 patch that prepares fbx for editing and importing back to game:
https://discord.com/channels/728022548796801064/747494223703572612/859212491207999508
Install it so that the Armature is now correct in Blender for fbx meshes. Then, you can skip any dae / visual studio steps.
I'm currently in the making of a hair replacement mod for Geralt that's based on Ragnar Lothbrok's hair from scratch. I'm halfway there with the model, and f I've made Geralt a new face just to get the hang of the procedure of exporting importing cooking and stuff. Now the next step should be to take a peek of the yet-basic model, how it looks ingame. The model's rigged it shows ingame but I just can't get the textures working, it's not 3ds max's fault 'cause the head model was just fine.
If you can help me out here or in DM I'd be grateful. Thanks in Advance!
I saw you releasing it, so I guess it went ok afterwards. Please don't hesitate writing a DM next time, if the help would be needed.
I can only cook with Modkitchen, everything else won't work. But if I use modkitchen the xml info gets broken(I think). In wolven kit I could see that the Cmaterialinstance's Instanceparameters "folder" is empty in the w2mesh file. So I have to copy these parameters from a pre-existing one to the new one, then make the w2mesh file write-protected, then cook it again in ModKitchen. It's kinda annoying. So if you have any idea what is at fault please help me!
Cheers!
First off, thank you for this guide! It's been helpful!
I've been working for a while on trying to create a mod but I'm running into an issue. I am trying to take the "Alternate Olgierd Hairstyle" - from the below two mods on nexus - and make the hair black instead of white. I have two mods that change the hair colors (scalp included) to black to both regular and Hairworks, and these mods work! For ALL the hairstyles EXCEPT this particular one.
https://www.nexusmods.com/witcher3/mods/4400 (hair name = alternate olgierd hair")
https://www.nexusmods.com/witcher3/mods/2749 (this mod is just this particular hairstyle)
I'm not a modder so after weeks of fiddling around and watching videos etc, I finally figured out how to change the hair color and it shows up in the game the color I want it to (I've done this by replacing the original "Spiked Tail" hair in the DLC2 file)
however... my issue now that I'm stuck on is what seems to be a physics issue? I've attached a picture.When you stand up it looks like the tip of the hair is static, and the root moves with the head. If I take a step forward, the roots follow the head like normal but the mesh stretches and the tips of the hair drag behind and only catch up when I stop moving.
I've tried making sure I have my .reddlc file, my w2ent file, my updated Diff & Norm files. An updated "root color" file. I've changed the specular color and variance color in the w2mesh info via Wolvenkit. I've tried adding the corresponding dyng file and head mesh file. I tried my hand at weight painting in Blender. I've tried importing/exporting FBX/DAE files via other applications in case Blender is messing up the file. I have my buffer file there. I've tried uninstalling ANY mod I have that even touches hair/face/head anything and it still does the same thing.
I'm out of ideas! I'm using WolvenKit and ModKitchen to tackle this.
Any advice is appreciated!
If you didn't export and edited the .w2mesh, make sure that your w2ent is set up to have matching set of w2mesh and w3dyng.
If you edited it, make sure all of the vertices are weighted by at least one vertex group. If they are, check the list of vertex groups and make sure they correspond with bones in your armature. Also, make sure your armature corresponds with the w3dyng by comparing bone names between the two.
The original mods (both of them) work already, so I assume the vertices are weighted and such. I'm only changing the diffuse attached and the shader color in Blender. I'm not touching any of the bones or anything. Does exporting the file to an FBX make it so it has to be re-weighted?
I'm sorry if I sound like I don't know what I'm talking about because I dont haha. Blender has been a huge learning curve for me.
i'm running into a weird problem though. the hair is definitely changing colors, but when the character is approached, the hair reverts to its original color. The new hair color only shows up at a certain distance from them.
I'm having trouble experimenting on inverted hair
I changed Triss' hair with Corine Tilly's, mirrored in Blender then vertex-painted it red. I cooked the fbx with Triss' xml file in w3oven and packed it with Corine's dyng file
The result is weird: light mapping seems to be off especially in front of the lighthouse fire. Shadings off front and back seems to have swapped
Then I cooked another fbx, this time with Corine's xml file but altered to have the instances value similar to Triss'xml. Result is pretty much the same
Can you help me out?
You should reset them so now they're corresponding. It can be Normals -> Recalculate Inside/Outside, Normals -> Set from Faces, or applying Weighted Normals modifier.
Also you may want to make sure your xml is using the same texture set as vanilla Corinne hair do. It may look ok, but at the same time UVs are not uniform and so there may be holes or distortions (or none, too).
But light mapping is still off, now its uniform regardless of the light source. Looking like Dark Phoenix tho: https://i.imgur.com/TBkvuqz.jpg
I'm getting there. There are much rooms for improvements and your guidance helped a lot. I'm going to try the modifier as well, once again thanks!