NpcAnimation: Assign parent animation time sources to body part controllers (bug #4822)

macos_ci_fix
Alexei Kotov 5 months ago
parent 7e3270abc9
commit 2628b02b4e

@ -14,6 +14,7 @@
Bug #4743: PlayGroup doesn't play non-looping animations correctly
Bug #4754: Stack of ammunition cannot be equipped partially
Bug #4816: GetWeaponDrawn returns 1 before weapon is attached
Bug #4822: Non-weapon equipment and body parts can't inherit time from parent animation
Bug #5057: Weapon swing sound plays at same pitch whether it hits or misses
Bug #5062: Root bone rotations for NPC animation don't work the same as for creature animation
Bug #5066: Quirks with starting and stopping scripted animations

@ -315,6 +315,7 @@ namespace MWRender
if (node == nullptr)
return;
// This is used to avoid playing animations intended for equipped weapons on holstered weapons.
SceneUtil::ForceControllerSourcesVisitor removeVisitor(std::make_shared<NullAnimationTime>());
node->accept(removeVisitor);
}
@ -346,9 +347,7 @@ namespace MWRender
if (mesh.empty() || boneName.empty())
return;
// If the scabbard is not found, use a weapon mesh as fallback.
// Note: it is unclear how to handle time for controllers attached to bodyparts, so disable them for now.
// We use the similar approach for other bodyparts.
// If the scabbard is not found, use the weapon mesh as fallback.
scabbardName = scabbardName.replace(scabbardName.size() - 4, 4, "_sh.nif");
bool isEnchanted = !weapon->getClass().getEnchantment(*weapon).empty();
if (!mResourceSystem->getVFS()->exists(scabbardName))

@ -168,7 +168,7 @@ namespace MWRender
if (slot == MWWorld::InventoryStore::Slot_CarriedRight)
source = mWeaponAnimationTime;
else
source = std::make_shared<NullAnimationTime>();
source = mAnimationTimePtr[0];
SceneUtil::AssignControllerSourcesVisitor assignVisitor(source);
attached->accept(assignVisitor);

@ -851,7 +851,7 @@ namespace MWRender
if (type == ESM::PRT_Weapon)
src = mWeaponAnimationTime;
else
src = std::make_shared<NullAnimationTime>();
src = mAnimationTimePtr[0];
SceneUtil::AssignControllerSourcesVisitor assignVisitor(src);
node->accept(assignVisitor);
}

Loading…
Cancel
Save