mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 12:39:53 +00:00
Use common function for blendmask detection, remove extra debug logs
This commit is contained in:
parent
2efc691736
commit
33afcbdc13
@ -557,7 +557,7 @@ namespace MWRender
|
||||
mResetAccumRootCallback->setAccumulate(mAccumulate);
|
||||
}
|
||||
|
||||
size_t Animation::detectBlendMask(const osg::Node* node) const
|
||||
size_t Animation::detectBlendMask(const osg::Node* node, const std::string& controllerName) const // controllerName is used for Collada animated deforming models
|
||||
{
|
||||
static const std::string_view sBlendMaskRoots[sNumBlendMasks] = {
|
||||
"", /* Lower body / character root */
|
||||
@ -571,8 +571,7 @@ namespace MWRender
|
||||
const std::string& name = node->getName();
|
||||
for (size_t i = 1; i < sNumBlendMasks; i++)
|
||||
{
|
||||
Log(Debug::Warning) << "blendmaskname:" << name;
|
||||
if (name == sBlendMaskRoots[i])
|
||||
if (name == sBlendMaskRoots[i] || controllerName == sBlendMaskRoots[i])
|
||||
return i;
|
||||
}
|
||||
|
||||
@ -584,27 +583,6 @@ namespace MWRender
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t Animation::detectColladaBlendMask(const osg::Node* node, const std::string& blendmaskName) const
|
||||
{
|
||||
static const std::string_view sBlendMaskRoots[sNumBlendMasks] = {
|
||||
"", /* Lower body / character root */
|
||||
"Bip01 Spine1", /* Torso */
|
||||
"Bip01 L Clavicle", /* Left arm */
|
||||
"Bip01 R Clavicle", /* Right arm */
|
||||
};
|
||||
|
||||
for (size_t i = 1; i < sNumBlendMasks; i++)
|
||||
{
|
||||
Log(Debug::Warning) << "blendmaskname:" << blendmaskName;
|
||||
if (blendmaskName == sBlendMaskRoots[i])
|
||||
return i;
|
||||
}
|
||||
assert(node->getNumParents() > 0);
|
||||
node = node->getParent(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const SceneUtil::TextKeyMap& Animation::AnimSource::getTextKeys() const
|
||||
{
|
||||
return mKeyframes->mTextKeys;
|
||||
@ -668,8 +646,7 @@ namespace MWRender
|
||||
|
||||
osg::Node* node = found->second;
|
||||
|
||||
size_t blendMask = detectColladaBlendMask(node, it->second->getName());
|
||||
Log(Debug::Warning) << "blendmask " << blendMask << " ctrl name: " << it->second->getName();
|
||||
size_t blendMask = detectBlendMask(node, it->second->getName());
|
||||
|
||||
// clone the controller, because each Animation needs its own ControllerSource
|
||||
osg::ref_ptr<SceneUtil::KeyframeController> cloned
|
||||
|
@ -292,8 +292,7 @@ namespace MWRender
|
||||
*/
|
||||
void resetActiveGroups();
|
||||
|
||||
size_t detectBlendMask(const osg::Node* node) const;
|
||||
size_t detectColladaBlendMask(const osg::Node* node, const std::string& blendmaskName) const;
|
||||
size_t detectBlendMask(const osg::Node* node, const std::string& controllerName) const;
|
||||
|
||||
/* Updates the position of the accum root node for the given time, and
|
||||
* returns the wanted movement vector from the previous time. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user