BadDogSkyrim / PyNifly

Export/Import tools between Blender and the Nif format, using Bodyslide/Outfit Studio's Nifly layer. Supports Skyrim LE, Skyrim SE, Fallout 4, Fallout New Vegas, Fallout 76, and Fallout 3.
GNU General Public License v3.0
167 stars 15 forks source link

Bone hierarchy is not preserved on custom SMP skeletons #193

Closed HeinrichGuil closed 8 months ago

HeinrichGuil commented 8 months ago

Steps to reproduce: import any SMP-enabled armor, export it. Check bone hierarchy in NifScope

Expected results: custom bones are children of vanilla bones, custom bones hierarchy is preserved Actual results: custom bones lost any hierarchic relations.

HeinrichGuil commented 8 months ago

https://drive.google.com/file/d/1QgPR_tf3p_tHCBw_HXXSNACrhXsbMuj0/view?usp=sharing Here is an example of mesh and xml manifest. It's in working condition, but after re-export bones are not preserved wether checkbox for preserve hierarchy checked or not

BadDogSkyrim commented 8 months ago

Yeah, that's a mess. I'll look.

BadDogSkyrim commented 8 months ago

Okay, less of a mess than I thought. Some weirdness, some things maybe suboptimal, but no actual bugs.

On import, turn OFF "Create Bones". When we export the bone hierarchy we don't know where to stop so we just follow the bone parents until we run out. If you allow the import to create the full hierarchy you get a bunch of bones you don't want.

Alternatively, delete the unwanted bones from the armature before exporting.

On import turn OFF "Create armature from pose position". One of your meshes has a different offset from the rest (the tail). That causes it to show up in a different location in Blender. This switch handles this situation.

Now on export, set "Preserve bone hierarchy" and the result should be correct.

HeinrichGuil commented 8 months ago

It's actually working, thanks a lot. I even managed to adjust the skinning of simulated parts. Now I will try to make auxiliary bones in blender.

HeinrichGuil commented 8 months ago

Strangely enough second pass of the same procedure explained by you above leads to model imported without relation between first bones of auxiliary chains and vanilla skeletons. I've tried a few times and it replicates. Parenting bones by hand after that fixes the issue