summaryrefslogtreecommitdiff
path: root/indra/llappearance/llavatarappearance.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-12-13 16:04:10 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-12-13 16:04:10 +0000
commit49d924ae295190dbce999e5b8e31909c5fc4a22e (patch)
treed9af66198caeb94f2e2f33279ca17fe7d033d19a /indra/llappearance/llavatarappearance.cpp
parent9f1482501348b36ef51b5eacfb6ddd62f83b814c (diff)
MAINT-7528 - allow underscores to substitute for spaces in uploaded meshes - this allows rigging to some attachment points that will not otherwise work
Diffstat (limited to 'indra/llappearance/llavatarappearance.cpp')
-rw-r--r--indra/llappearance/llavatarappearance.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 94c431feb4..62273339f7 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -1723,7 +1723,7 @@ void LLAvatarAppearance::makeJointAliases(LLAvatarBoneInfo *bone_info)
}
mJointAliasMap[*i] = bone_name;
}
-
+
LLAvatarBoneInfo::child_list_t::const_iterator iter;
for (iter = bone_info->mChildList.begin(); iter != bone_info->mChildList.end(); ++iter)
{
@@ -1738,13 +1738,34 @@ const LLAvatarAppearance::joint_alias_map_t& LLAvatarAppearance::getJointAliases
{
LLAvatarSkeletonInfo::bone_info_list_t::const_iterator iter;
- for (iter = sAvatarSkeletonInfo->mBoneInfoList.begin(); iter != sAvatarSkeletonInfo->mBoneInfoList.end(); ++iter)
+ for (iter = sAvatarSkeletonInfo->mBoneInfoList.begin();
+ iter != sAvatarSkeletonInfo->mBoneInfoList.end();
+ ++iter)
{
//LLAvatarBoneInfo *bone_info = *iter;
makeJointAliases( *iter );
}
+
+ LLAvatarXmlInfo::attachment_info_list_t::iterator attach_iter;
+ for (attach_iter = sAvatarXmlInfo->mAttachmentInfoList.begin();
+ attach_iter != sAvatarXmlInfo->mAttachmentInfoList.end();
+ ++attach_iter)
+ {
+ LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *attach_iter;
+ std::string bone_name = info->mName;
+
+ // Also accept the name with spaces substituted with
+ // underscores. This gives a mechanism for referencing such joints
+ // in daes, which don't allow spaces.
+ std::string sub_space_to_underscore = bone_name;
+ LLStringUtil::replaceChar(sub_space_to_underscore, ' ', '_');
+ if (sub_space_to_underscore != bone_name)
+ {
+ mJointAliasMap[sub_space_to_underscore] = bone_name;
+ }
+ }
}
-
+
return mJointAliasMap;
}