1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 17:39:42 +00:00

Merge branch 'catfight' into 'master'

Restore female/beast-specific first person animations (#8179)

Closes #8179

See merge request OpenMW/openmw!4392
This commit is contained in:
jvoisin 2024-09-30 11:21:51 +00:00
commit 1bc130332e

View file

@ -484,15 +484,24 @@ namespace MWRender
bool is1stPerson = mViewMode == VM_FirstPerson;
bool isBeast = (race->mData.mFlags & ESM::Race::Beast) != 0;
std::string_view base;
if (!isWerewolf)
{
if (!is1stPerson)
base = Settings::models().mXbaseanim.get().value();
else
base = Settings::models().mXbaseanim1st.get().value();
}
const std::string defaultSkeleton = Misc::ResourceHelpers::correctActorModelPath(
getActorSkeleton(is1stPerson, isFemale, isBeast, isWerewolf), mResourceSystem->getVFS());
std::string smodel = defaultSkeleton;
bool isBase = !isWerewolf;
bool isCustomModel = false;
if (!is1stPerson && !isWerewolf && !mNpc->mModel.empty())
{
std::string model = Misc::ResourceHelpers::correctMeshPath(mNpc->mModel);
isBase = isDefaultActorSkeleton(model);
isCustomModel = !isDefaultActorSkeleton(model);
smodel = Misc::ResourceHelpers::correctActorModelPath(model, mResourceSystem->getVFS());
}
@ -500,33 +509,21 @@ namespace MWRender
updateParts();
if (!is1stPerson)
if (!base.empty())
addAnimSource(base, smodel);
if (defaultSkeleton != base)
addAnimSource(defaultSkeleton, smodel);
if (isCustomModel)
addAnimSource(smodel, smodel);
const bool customArgonianSwim = !is1stPerson && !isWerewolf && isBeast && mNpc->mRace.contains("argonian");
if (customArgonianSwim)
addAnimSource(Settings::models().mXargonianswimkna.get().value(), smodel);
if (is1stPerson)
{
const std::string& base = Settings::models().mXbaseanim.get().value();
if (!isWerewolf)
addAnimSource(base, smodel);
if (!isBase)
{
addAnimSource(defaultSkeleton, smodel);
addAnimSource(smodel, smodel);
}
else if (base != defaultSkeleton)
{
addAnimSource(defaultSkeleton, smodel);
}
if (!isWerewolf && isBeast && mNpc->mRace.contains("argonian"))
addAnimSource("meshes\\xargonian_swimkna.nif", smodel);
}
else
{
if (!isWerewolf)
addAnimSource(Settings::models().mXbaseanim1st.get().value(), smodel);
if (!isBase)
addAnimSource(smodel, smodel);
mObjectRoot->setNodeMask(Mask_FirstPerson);
mObjectRoot->addCullCallback(new OverrideFieldOfViewCallback(mFirstPersonFieldOfView));
}