Jump to content

Need help making hair collisions work on hair converted from wig to racemenu


Recommended Posts

Hello,

 

I converted a wig mod to a racemenu hair by making some simple edits to the nif and esp.

I split meshes from the original wig into their own nif files. That includes the collision body the wig came with.

Once the meshes were split I edited the esp for the wig mod, creating head parts for each of the nif files.

I have one primary hair mesh while the other meshes we're made into extra head parts in the esp (Virtual ground, collision head, collision body, and an extra textured hair piece).

The extra piece of textured hair appears alongside the main hair when selected in racemenu, so I at least have the base extra parts set up correctly but the collisions do not work and the hair clips into my character's body.

The racemenu version of the hair clips into my character's body but the original wig still has functional collisions when equipped.

 

I have checked to make sure file paths and extra parts are set correctly in the esp, physics are still enabled on the body and hair meshes when I checked in nifskope, and I've made sure that the .tri morphs for the collision body are referenced under "parts" in it's head part.

 

What am I missing to make the hair/body collisions work as a racemenu hair?

I've attached a copy of the mod with my edits below but this is not my mod so here's a link to the original https://arca.live/b/tullius/56078426?category=의상&target=all&keyword=twintail&p=1#comment

Twintail(edited).zip

Link to comment

Comparing to another mod with similar functionality:

  1. The collision body is a BSTriShape, whereas in your conversion its a BSDynamicTriShape.
  2. The collision body is separate from the hair nif(s), whereas in your mod its all merged together in one nif.

Other notes:

  1. With a full-resolution collision body like you're using, you're probably not gaining any performance by using a virtual collision body. Just set the collisions to public and use the actual body instead - same result, less work. Maybe this is WIP and you intend to decimate it later.
  2. Mixed use of can-collide-with-* and no-collide-with-* as far as I know is not good. Basically what you're saying with the can-collide-with-* statments is that it can ONLY collide with said things; and with the no-collide-with-* statements that it can NEVER collide with said things. It's a situation where a blacklist and a whitelist is used simultaneously, and I do not know which one takes precedence. Clean this up.
  3. Remove all weight-threshold elements and test again.
Link to comment
9 hours ago, traison said:

Comparing to another mod with similar functionality:

  1. The collision body is a BSTriShape, whereas in your conversion its a BSDynamicTriShape.
  2. The collision body is separate from the hair nif(s), whereas in your mod its all merged together in one nif.

Other notes:

  1. With a full-resolution collision body like you're using, you're probably not gaining any performance by using a virtual collision body. Just set the collisions to public and use the actual body instead - same result, less work. Maybe this is WIP and you intend to decimate it later.
  2. Mixed use of can-collide-with-* and no-collide-with-* as far as I know is not good. Basically what you're saying with the can-collide-with-* statments is that it can ONLY collide with said things; and with the no-collide-with-* statements that it can NEVER collide with said things. It's a situation where a blacklist and a whitelist is used simultaneously, and I do not know which one takes precedence. Clean this up.
  3. Remove all weight-threshold elements and test again.

Thank you for this post. I made edits based on the information you provided but still can't get collisions between the hair and the body from the racemenu hair.

I tried removing the virtual body from the esp and xml then replaced it with my body mod in the xml but still had clipping.

This is very much a WIP and I would love to remove the virtual body or at least decimate it later; but I'm not concerned with performance until I can get the collisions working on the racemenu hair.

 

What confuses me is that the wig collisions work with all the same meshes while the racemenu hair clips into the body. The only difference between them should be that the racemenu version is separated meshes combined using extra head parts in the esp.

EDIT: How can the physics themselves work and extra head part meshes be loaded properly in game (side hair piece is evidence of this) and yet the collisions don't work?

 

I apologize if I'm missing something obvious, this is my first time working with collisions like this and I'm no developer.

I've attached the new edited version here. Twintail(2nd Edit).zip

Twintail(2nd Edit).zip

Edited by DuckytheBOT
More info added
Link to comment

Unfortunately I'm not seeing anything wrong with this, except for the (obvious) broken collisions. esp looks fine, nifs look fine, xml looks fine, no errors or warning in smp log. SMP is aware of all HDPT meshes as evident in the log. It's not the bug where FSMP sometimes ignores collisions completely (happens for select items only) until "smp reset" is issued.

 

I feel like there's some microscopic difference somewhere that breaks it all; something I couldn't detect in ~1 hour. I don't know anything about HDPT myself, I'm just comparing your stuff to that of Dint999.

Link to comment
6 minutes ago, traison said:

Unfortunately I'm not seeing anything wrong with this, except for the (obvious) broken collisions. esp looks fine, nifs look fine, xml looks fine, no errors or warning in smp log. SMP is aware of all HDPT meshes as evident in the log. It's not the bug where FSMP sometimes ignores collisions completely (happens for select items only) until "smp reset" is issued.

 

I feel like there's some microscopic difference somewhere that breaks it all; something I couldn't detect in ~1 hour. I don't know anything about HDPT myself, I'm just comparing your stuff to that of Dint999.

 

That sucks. :( At least I know a bit more about xmls now I appreciate you taking time out of your day to look into this though.

Link to comment

Got my answer from a kind person in a discord server. Posting here again in case someone else happens across the same issue in the future and needs an answer.

 

The solution in my case was to make sure the editor IDs and names in the xml files match, because racemenu uses editor IDs for the names in the xml.

This applies to all the meshes but I'll use the collision body for this example:

 

When the collisions didn't work, the editor ID of my mesh was set to CollisionBody in the esp but referred to as VB in the xml. This allowed the hair to clip into the body because racemenu was not aware it was supposed to be applying collision body physics to the mesh even though it was being loaded in.

So to fix the issue I could have either renamed the editor ID to VB in the esp or CollisionBody in the xml. As long as both are the same, physics with collisions will be applied normally.

In the end I renamed the editor IDs to match the xml file and physics work as expected. :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use