mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-29 03:26:38 +00:00 
			
		
		
		
	Don't updateBoneTree for non-skinned parts (Fixes #2124)
This commit is contained in:
		
							parent
							
								
									b650338d69
								
							
						
					
					
						commit
						75b0da5dce
					
				
					 1 changed files with 22 additions and 5 deletions
				
			
		|  | @ -60,6 +60,21 @@ std::string getVampireHead(const std::string& race, bool female) | |||
|     return "meshes\\" + sVampireMapping[thisCombination]->mModel; | ||||
| } | ||||
| 
 | ||||
| bool isSkinned (NifOgre::ObjectScenePtr scene) | ||||
| { | ||||
|     if (scene->mSkelBase == NULL) | ||||
|         return false; | ||||
|     for(size_t j = 0; j < scene->mEntities.size(); j++) | ||||
|     { | ||||
|         Ogre::Entity *ent = scene->mEntities[j]; | ||||
|         if(scene->mSkelBase != ent && ent->hasSkeleton()) | ||||
|         { | ||||
|             return true; | ||||
|         } | ||||
|     } | ||||
|     return false; | ||||
| } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | @ -611,10 +626,11 @@ Ogre::Vector3 NpcAnimation::runAnimation(float timepassed) | |||
|         for(;ctrl != mObjectParts[i]->mControllers.end();++ctrl) | ||||
|             ctrl->update(); | ||||
| 
 | ||||
|         Ogre::Entity *ent = mObjectParts[i]->mSkelBase; | ||||
|         if(!ent) continue; | ||||
|         updateSkeletonInstance(baseinst, ent->getSkeleton()); | ||||
|         ent->getAllAnimationStates()->_notifyDirty(); | ||||
|         if (!isSkinned(mObjectParts[i])) | ||||
|             continue; | ||||
| 
 | ||||
|         updateSkeletonInstance(baseinst, mObjectParts[i]->mSkelBase->getSkeleton()); | ||||
|         mObjectParts[i]->mSkelBase->getAllAnimationStates()->_notifyDirty(); | ||||
|     } | ||||
| 
 | ||||
|     return ret; | ||||
|  | @ -697,6 +713,7 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g | |||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (isSkinned(mObjectParts[type])) | ||||
|             updateSkeletonInstance(mSkelBase->getSkeleton(), skel); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue