mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
Skip creating meshes for hidden nodes with no VisControllers
There's quite a bit of garbage in base_anim.nif, so this change should result in a much leaner scene graph.
This commit is contained in:
parent
e938fa4a9d
commit
caa93f767b
@ -562,10 +562,20 @@ namespace NifOsg
|
|||||||
transformNode->setNodeMask(0x1);
|
transformNode->setNodeMask(0x1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We could probably skip hidden nodes entirely if they don't have a VisController that
|
// We can skip creating meshes for hidden nodes if they don't have a VisController that
|
||||||
// might make them visible later
|
// might make them visible later
|
||||||
if (nifNode->flags & Nif::NiNode::Flag_Hidden)
|
if (nifNode->flags & Nif::NiNode::Flag_Hidden)
|
||||||
transformNode->setNodeMask(0x1); // Leave mask for UpdateVisitor enabled
|
{
|
||||||
|
bool hasVisController = false;
|
||||||
|
for (Nif::ControllerPtr ctrl = nifNode->controller; !ctrl.empty(); ctrl = ctrl->next)
|
||||||
|
hasVisController = (ctrl->recType == Nif::RC_NiVisController);
|
||||||
|
|
||||||
|
if (!hasVisController)
|
||||||
|
skipMeshes = true; // skip child meshes, but still create the child node hierarchy for animating collision shapes
|
||||||
|
|
||||||
|
// now hide this node, but leave the mask for UpdateVisitor enabled so that KeyframeController works
|
||||||
|
transformNode->setNodeMask(0x1);
|
||||||
|
}
|
||||||
|
|
||||||
applyNodeProperties(nifNode, transformNode, boundTextures, animflags);
|
applyNodeProperties(nifNode, transformNode, boundTextures, animflags);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user