forked from teamnwah/openmw-tes3coop
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
1 changed files with 12 additions and 2 deletions
|
@ -562,10 +562,20 @@ namespace NifOsg
|
|||
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
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue