mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-11-04 08:56:48 +00:00 
			
		
		
		
	Animation sources are treated differently from base objects. When given "path\file.nif", base objects will look for "path\xfile.nif" and use that if it exists (falling back to the original name if not found). Animation sources will instead use "path\xfile.kf", ignoring it if the file doesn't exist.
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			746 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			746 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#include "creatureanimation.hpp"
 | 
						|
 | 
						|
#include "renderconst.hpp"
 | 
						|
 | 
						|
#include "../mwbase/world.hpp"
 | 
						|
 | 
						|
namespace MWRender
 | 
						|
{
 | 
						|
 | 
						|
CreatureAnimation::~CreatureAnimation()
 | 
						|
{
 | 
						|
}
 | 
						|
 | 
						|
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr &ptr)
 | 
						|
  : Animation(ptr)
 | 
						|
{
 | 
						|
    MWWorld::LiveCellRef<ESM::Creature> *ref = mPtr.get<ESM::Creature>();
 | 
						|
 | 
						|
    assert (ref->mBase != NULL);
 | 
						|
    if(!ref->mBase->mModel.empty())
 | 
						|
    {
 | 
						|
        std::string model = "meshes\\"+ref->mBase->mModel;
 | 
						|
 | 
						|
        setObjectRoot(mPtr.getRefData().getBaseNode(), model, false);
 | 
						|
        setRenderProperties(mObjectRoot, RV_Actors, RQG_Main, RQG_Alpha);
 | 
						|
 | 
						|
        if((ref->mBase->mFlags&ESM::Creature::Biped))
 | 
						|
            addAnimSource("meshes\\base_anim.nif");
 | 
						|
        addAnimSource(model);
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
}
 |