Skip to content

Commit

Permalink
Merge branch 'getBoneByName_searchRoot' into 'master'
Browse files Browse the repository at this point in the history
make ActorAnimation::getBoneByName take a searchRoot param

See merge request OpenMW/openmw!4491
  • Loading branch information
psi29a committed Dec 31, 2024
2 parents d476c8c + e77db9f commit 2436142
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/openmw/mwrender/actoranimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,17 @@ namespace MWRender
}

mScabbard = attachMesh(scabbardName, boneName);
if (mScabbard && weaponClass == ESM::WeaponType::Ranged)

if (!mScabbard || !mScabbard->getNode())
return;

if (weaponClass == ESM::WeaponType::Ranged)
resetControllers(mScabbard->getNode());

osg::Group* weaponNode = getBoneByName("Bip01 Weapon");
SceneUtil::FindByNameVisitor findVisitor("Bip01 Weapon");
mScabbard->getNode()->accept(findVisitor);
osg::Group* weaponNode = findVisitor.mFoundNode;

if (!weaponNode)
return;

Expand Down

0 comments on commit 2436142

Please sign in to comment.