Beamdog / nwn-issues

Neverwinter Nights: Enhanced Edition Technical Bug Tracker
http://nwn.beamdog.com
31 stars 1 forks source link

Skinmesh models don't inherit with DefaultPhenoType set #428

Open Finaldeath opened 2 years ago

Finaldeath commented 2 years ago

To Reproduce

Specifics

If needed, describe the bug

phenotype.2da has a "DefaultPhenoType" column that is meant to fall back any models not loaded to the parent model, eg pmh3 models would inherit from pmh0 models. This allows animation swapping and therefore horses.

The bug appears to be one that might be why Robes were included in all the horse phenotypes as additional models, is that skinmesh style models will simply not attach properly for whatever reason to the correct nodes. It might be trying to load them as if it was a different model type like trimesh?

The HD pack includes no animation/base models so it is not a problem with that, and included the MDL files are near identical in format to the old trimesh versions.

It seems silly to need to do this when these pmh3 files are identical to the originals in every aspect except they're an additional model, so you have around 20K extra models for no real reason.

Thankfully the textures do appear to properly go down to the pfh0 files where needed (ie pfh3belt001 can reference a pfh0 file and it appears to load it).

LaputianBird commented 2 years ago

Cloaks and robes use a different approach, it is not a bug, but rather a design flaw - their models are not attached as parts of the main appearance, therefore the animation supermodel specified in the root model (pmh3.mdl in the example) is irrelevant to them. Cloaks and robes instead use the supermodel specified locally in their mdl files. In practices this means that phenotype inheritance works for them, but causes animation misalignment as the supermodel isn't automatically overridden by the inheritance - and it's the reason why the horse phenotypes need their own phenotype-specific version of those models, as any other phenotype used to deliver alternative animations.

This is not to say that there isn't a bug associated with the BD HD models, but I cannot comment on that as I never trly tested them. I use my own skinmeshed PC parts, but never load them in the toolset (as the setup is too different from what the toolset expects), and at least in game I couldn't see any issue with switching phenotypes yet. I'll post again if I have the chance to stumble on something pertinent.

Finaldeath commented 2 years ago

Example demo module and hakpack: skinmesh_inheritence_demo.zip

The test model file used (pmh0_chest001.mdl) has no equivalent phenotype 3 (mounted) variant in the game files (ie no pmh3_chest001.mdl file exists) so it is using inheritance by default.

image