mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-13 06:13:06 +00:00
Use common function for blendmask detection, remove extra debug logs
This commit is contained in:
parent
2efc691736
commit
33afcbdc13
2 changed files with 4 additions and 28 deletions
|
|
@ -557,7 +557,7 @@ namespace MWRender
|
||||||
mResetAccumRootCallback->setAccumulate(mAccumulate);
|
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] = {
|
static const std::string_view sBlendMaskRoots[sNumBlendMasks] = {
|
||||||
"", /* Lower body / character root */
|
"", /* Lower body / character root */
|
||||||
|
|
@ -571,8 +571,7 @@ namespace MWRender
|
||||||
const std::string& name = node->getName();
|
const std::string& name = node->getName();
|
||||||
for (size_t i = 1; i < sNumBlendMasks; i++)
|
for (size_t i = 1; i < sNumBlendMasks; i++)
|
||||||
{
|
{
|
||||||
Log(Debug::Warning) << "blendmaskname:" << name;
|
if (name == sBlendMaskRoots[i] || controllerName == sBlendMaskRoots[i])
|
||||||
if (name == sBlendMaskRoots[i])
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -584,27 +583,6 @@ namespace MWRender
|
||||||
return 0;
|
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
|
const SceneUtil::TextKeyMap& Animation::AnimSource::getTextKeys() const
|
||||||
{
|
{
|
||||||
return mKeyframes->mTextKeys;
|
return mKeyframes->mTextKeys;
|
||||||
|
|
@ -668,8 +646,7 @@ namespace MWRender
|
||||||
|
|
||||||
osg::Node* node = found->second;
|
osg::Node* node = found->second;
|
||||||
|
|
||||||
size_t blendMask = detectColladaBlendMask(node, it->second->getName());
|
size_t blendMask = detectBlendMask(node, it->second->getName());
|
||||||
Log(Debug::Warning) << "blendmask " << blendMask << " ctrl name: " << it->second->getName();
|
|
||||||
|
|
||||||
// clone the controller, because each Animation needs its own ControllerSource
|
// clone the controller, because each Animation needs its own ControllerSource
|
||||||
osg::ref_ptr<SceneUtil::KeyframeController> cloned
|
osg::ref_ptr<SceneUtil::KeyframeController> cloned
|
||||||
|
|
|
||||||
|
|
@ -292,8 +292,7 @@ namespace MWRender
|
||||||
*/
|
*/
|
||||||
void resetActiveGroups();
|
void resetActiveGroups();
|
||||||
|
|
||||||
size_t detectBlendMask(const osg::Node* node) const;
|
size_t detectBlendMask(const osg::Node* node, const std::string& controllerName) const;
|
||||||
size_t detectColladaBlendMask(const osg::Node* node, const std::string& blendmaskName) const;
|
|
||||||
|
|
||||||
/* Updates the position of the accum root node for the given time, and
|
/* Updates the position of the accum root node for the given time, and
|
||||||
* returns the wanted movement vector from the previous time. */
|
* returns the wanted movement vector from the previous time. */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue