summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-05-09 10:25:30 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-05-09 10:25:30 -0400
commit184a5fd82be3a4969ac6547367d1aad458129461 (patch)
tree86b262109072ce50228935d1a31f5f4613e4f92e /indra/newview
parentd69c01ba80f733ab04d9d5e9588033ad5764331f (diff)
SL-315 - resetSkeleton() work, dae_tool.py can add random joint positions to models
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llvoavatar.cpp37
-rwxr-xr-xindra/newview/llvoavatar.h1
2 files changed, 38 insertions, 0 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 979bf96151..22df9c43d7 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1811,6 +1811,7 @@ void LLVOAvatar::resetSkeleton()
// Stop all animations
// Clear all attachment pos overrides
+ clearAttachmentPosOverrides();
// Preserve state of tweakable params
@@ -1841,6 +1842,7 @@ void LLVOAvatar::resetSkeleton()
#endif
// Restore attachment pos overrides
+ rebuildAttachmentPosOverrides();
// Restart animations
}
@@ -5328,9 +5330,44 @@ void LLVOAvatar::clearAttachmentPosOverrides()
pJoint->clearAttachmentPosOverrides();
}
}
+
+ // Attachment points
+ for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
+ iter != mAttachmentPoints.end();
+ ++iter)
+ {
+ LLViewerJointAttachment *attachment_pt = (*iter).second;
+ if (attachment_pt)
+ {
+ attachment_pt->clearAttachmentPosOverrides();
+ }
+ }
}
//-----------------------------------------------------------------------------
+// rebuildAttachmentPosOverrides
+//-----------------------------------------------------------------------------
+void LLVOAvatar::rebuildAttachmentPosOverrides()
+{
+ LLScopedContextString str("rebuildAttachmentPosOverrides " + getFullname());
+
+ // Attachment points
+ for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
+ iter != mAttachmentPoints.end();
+ ++iter)
+ {
+ LLViewerJointAttachment *attachment_pt = (*iter).second;
+ if (attachment_pt)
+ {
+ for (LLViewerJointAttachment::attachedobjs_vec_t::iterator at_it = attachment_pt->mAttachedObjects.begin();
+ at_it != attachment_pt->mAttachedObjects.end(); ++at_it)
+ {
+ addAttachmentPosOverridesForObject(*at_it);
+ }
+ }
+ }
+}
+//-----------------------------------------------------------------------------
// addAttachmentPosOverridesForObject
//-----------------------------------------------------------------------------
void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo)
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index c6bc2fd58f..0a3965a597 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -206,6 +206,7 @@ public:
bool jointIsRiggedTo(const std::string& joint_name);
bool jointIsRiggedTo(const std::string& joint_name, const LLViewerObject *vo);
void clearAttachmentPosOverrides();
+ void rebuildAttachmentPosOverrides();
void showAttachmentPosOverrides(bool verbose = false) const;
void getAttachmentOverrideNames(std::set<std::string>& names) const;