fix(nif): leave out a root node's rotation and translation

The client's render component sets the object's own position and
rotation on the root node it loads, over the stored ones, so a root's
turn never shows in game (its scale stays). NifFile now reads roots the
same way. LU Toolbox's .nif (root turned 90 degrees about X, the
NiLODNodes turned back) now stands up in icons and the dashboard's
views; every game .nif has an unturned root and reads as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 17:54:07 -05:00
parent 6208724e6a
commit 602acc0fe7
3 changed files with 92 additions and 11 deletions

View File

@@ -387,7 +387,14 @@ namespace {
reader.Skip(static_cast<uint64_t>(effectCount) * 4);
if (!reader.Ok()) return;
const auto world = parent.Then(av.transform);
// The client puts the object's own position and rotation in place of the root node's (the render component
// sets them on the loaded root), so a root's stored rotation and translation are never seen; its scale is kept
auto local = av.transform;
if (depth == 0) {
local.r = Transform{}.r;
local.t = {};
}
const auto world = parent.Then(local);
// Recorded even when hidden: attach points often are
if (!av.name.empty() && !m_Model.nodes.contains(av.name)) {
NifFile::NodeTransform node;