From 75ce10c580cdf673586e8122f060b3c7876380d9 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 16 Jul 2012 11:31:45 -0700 Subject: [PATCH] Don't load data for hidden meshes --- components/nifogre/ogre_nif_loader.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 1db0b92a5..044c9cd72 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -755,6 +755,13 @@ public: Ogre::Mesh *mesh = dynamic_cast(resource); assert(mesh && "Attempting to load a mesh into a non-mesh resource!"); + if(!mShapeName.length()) + { + if(mHasSkel) + mesh->setSkeletonName(mName); + return; + } + Nif::NIFFile nif(mName); Nif::Node *node = dynamic_cast(nif.getRecord(0)); findTriShape(mesh, node); @@ -778,8 +785,11 @@ public: { NIFMeshLoader *loader = &sLoaders[fullname]; *loader = *this; - loader->mShapeName = shape->name; - loader->mMaterialName = NIFMaterialLoader::getMaterial(shape, fullname, mGroup); + if(!(flags&0x01)) // Not hidden + { + loader->mShapeName = shape->name; + loader->mMaterialName = NIFMaterialLoader::getMaterial(shape, fullname, mGroup); + } mesh = meshMgr.createManual(fullname, mGroup, loader); }