diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index a724da1f71..c275d6a312 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -17,7 +17,7 @@ namespace MWRender { CreatureAnimation::CreatureAnimation( - const MWWorld::Ptr& ptr, const std::string& model, Resource::ResourceSystem* resourceSystem) + const MWWorld::Ptr& ptr, const std::string& model, Resource::ResourceSystem* resourceSystem, bool animated) : ActorAnimation(ptr, osg::ref_ptr(ptr.getRefData().getBaseNode()), resourceSystem) { MWWorld::LiveCellRef* ref = mPtr.get(); @@ -28,12 +28,14 @@ namespace MWRender if ((ref->mBase->mFlags & ESM::Creature::Bipedal)) addAnimSource(Settings::Manager::getString("xbaseanim", "Models"), model); - addAnimSource(model, model); + + if (animated) + addAnimSource(model, model); } } CreatureWeaponAnimation::CreatureWeaponAnimation( - const MWWorld::Ptr& ptr, const std::string& model, Resource::ResourceSystem* resourceSystem) + const MWWorld::Ptr& ptr, const std::string& model, Resource::ResourceSystem* resourceSystem, bool animated) : ActorAnimation(ptr, osg::ref_ptr(ptr.getRefData().getBaseNode()), resourceSystem) , mShowWeapons(false) , mShowCarriedLeft(false) @@ -45,10 +47,10 @@ namespace MWRender setObjectRoot(model, true, false, true); if ((ref->mBase->mFlags & ESM::Creature::Bipedal)) - { addAnimSource(Settings::Manager::getString("xbaseanim", "Models"), model); - } - addAnimSource(model, model); + + if (animated) + addAnimSource(model, model); mPtr.getClass().getInventoryStore(mPtr).setInvListener(this, mPtr); diff --git a/apps/openmw/mwrender/creatureanimation.hpp b/apps/openmw/mwrender/creatureanimation.hpp index 3342fb3967..05235e5191 100644 --- a/apps/openmw/mwrender/creatureanimation.hpp +++ b/apps/openmw/mwrender/creatureanimation.hpp @@ -15,7 +15,8 @@ namespace MWRender class CreatureAnimation : public ActorAnimation { public: - CreatureAnimation(const MWWorld::Ptr& ptr, const std::string& model, Resource::ResourceSystem* resourceSystem); + CreatureAnimation( + const MWWorld::Ptr& ptr, const std::string& model, Resource::ResourceSystem* resourceSystem, bool animated); virtual ~CreatureAnimation() {} }; @@ -28,7 +29,7 @@ namespace MWRender { public: CreatureWeaponAnimation( - const MWWorld::Ptr& ptr, const std::string& model, Resource::ResourceSystem* resourceSystem); + const MWWorld::Ptr& ptr, const std::string& model, Resource::ResourceSystem* resourceSystem, bool animated); virtual ~CreatureWeaponAnimation() {} void equipmentChanged() override { updateParts(); } diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index c77e248f41..ba4ab45c60 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -93,16 +93,18 @@ namespace MWRender insertBegin(ptr); ptr.getRefData().getBaseNode()->setNodeMask(Mask_Actor); + bool animated = true; std::string animationMesh = Misc::ResourceHelpers::correctActorModelPath(mesh, mResourceSystem->getVFS()); - // FIXME: if animationMesh == mesh, the creature shouldn't be animated + if (animationMesh == mesh) + animated = false; // CreatureAnimation osg::ref_ptr anim; if (weaponsShields) - anim = new CreatureWeaponAnimation(ptr, animationMesh, mResourceSystem); + anim = new CreatureWeaponAnimation(ptr, animationMesh, mResourceSystem, animated); else - anim = new CreatureAnimation(ptr, animationMesh, mResourceSystem); + anim = new CreatureAnimation(ptr, animationMesh, mResourceSystem, animated); if (mObjects.emplace(ptr.mRef, anim).second) ptr.getClass().getContainerStore(ptr).setContListener(static_cast(anim.get()));