From 508cf89f9c8cb635a0c7767e9d80aae7f83393e1 Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Wed, 1 Jul 2020 12:42:03 +0300 Subject: [PATCH] get names of bones and skeleton to osg nodes --- src/osgPlugins/dae/daeRSkinning.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osgPlugins/dae/daeRSkinning.cpp b/src/osgPlugins/dae/daeRSkinning.cpp index 5ba0ed07e..2a9c2bc86 100644 --- a/src/osgPlugins/dae/daeRSkinning.cpp +++ b/src/osgPlugins/dae/daeRSkinning.cpp @@ -252,11 +252,19 @@ void daeReader::processSkeletonSkins(domNode* skeletonRoot, const domInstance_co { osgAnimation::Bone* pOsgBone = getOrCreateBone(jointsAndInverseBindMatrices[j].first); pOsgBone->setInvBindMatrixInSkeletonSpace(jointsAndInverseBindMatrices[j].second); + unsigned int numAttrs = jointsAndInverseBindMatrices[j].first->getAttributeCount(); + for ( unsigned int currAttr = 0; currAttr < numAttrs; ++currAttr ) + if (jointsAndInverseBindMatrices[j].first->getAttributeName(currAttr) == "name") + pOsgBone->setName(jointsAndInverseBindMatrices[j].first->getAttribute( currAttr )); } } osgAnimation::Skeleton* skeleton = getOrCreateSkeleton(skeletonRoot); + unsigned int numAttrs = skeletonRoot->getAttributeCount(); + for ( unsigned int currAttr = 0; currAttr < numAttrs; ++currAttr ) + if (skeletonRoot->getAttributeName(currAttr) == "name") skeleton->setName(skeletonRoot->getAttribute( currAttr )); + for (size_t i = 0; i < instanceControllers.size(); ++i) { domInstance_controller *pDomInstanceController = instanceControllers[i];