diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 991ef827e0..00583d4272 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -342,7 +342,7 @@ void NpcAnimation::updateParts() NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, const std::string &bonename) { NifOgre::EntityList entities = NIFLoader::createEntities(mEntityList.mSkelBase, bonename, - mInsert->getCreator(), mesh); + mInsert, mesh); std::vector &parts = entities.mEntities; for(size_t i = 0;i < parts.size();i++) parts[i]->setVisibilityFlags(RV_Actors); diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 8e73c2503b..646ec6c0b4 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -925,7 +925,7 @@ EntityList NIFLoader::createEntities(Ogre::SceneNode *parent, const std::string } EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bonename, - Ogre::SceneManager *sceneMgr, + Ogre::SceneNode *parentNode, const std::string &name, const std::string &group) { @@ -935,6 +935,7 @@ EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bo if(meshes.size() == 0) return entitylist; + Ogre::SceneManager *sceneMgr = parentNode->getCreator(); std::string filter = "Tri "+bonename; for(size_t i = 0;i < meshes.size();i++) { @@ -957,14 +958,14 @@ EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bo if(entitylist.mSkelBase) { entitylist.mSkelBase->shareSkeletonInstanceWith(parent); - parent->attachObjectToBone(bonename, entitylist.mSkelBase); + parentNode->attachObject(entitylist.mSkelBase); for(size_t i = 0;i < entitylist.mEntities.size();i++) { Ogre::Entity *entity = entitylist.mEntities[i]; if(entity != entitylist.mSkelBase && entity->hasSkeleton()) { entity->shareSkeletonInstanceWith(parent); - parent->attachObjectToBone(bonename, entity); + parentNode->attachObject(entity); } else if(entity != entitylist.mSkelBase) parent->attachObjectToBone(bonename, entity); diff --git a/components/nifogre/ogre_nif_loader.hpp b/components/nifogre/ogre_nif_loader.hpp index 49d19fdb88..76e94975cb 100644 --- a/components/nifogre/ogre_nif_loader.hpp +++ b/components/nifogre/ogre_nif_loader.hpp @@ -91,7 +91,7 @@ class NIFLoader public: static EntityList createEntities(Ogre::Entity *parent, const std::string &bonename, - Ogre::SceneManager *sceneMgr, + Ogre::SceneNode *parentNode, const std::string &name, const std::string &group="General");