summaryrefslogtreecommitdiff
path: root/indra/llprimitive/lldaeloader.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-09-02 16:44:57 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-09-02 16:44:57 -0400
commit34ced1aa2cc286db26e2866cfc7a53ef72d828a4 (patch)
tree7ae48b379e7e1916d9d22d390ad9466f7b255402 /indra/llprimitive/lldaeloader.cpp
parenta2875ba53ec02235a0db5734264108c0f0898269 (diff)
SL-395 - partial support for joint scale locking via flag in skin info
Diffstat (limited to 'indra/llprimitive/lldaeloader.cpp')
-rw-r--r--indra/llprimitive/lldaeloader.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index 37ebdf2cec..c194d677c8 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -1379,6 +1379,16 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
if ( !missingSkeletonOrScene )
{
+ // FIXME: mesh_id is used to determine which mesh gets to
+ // set the joint offset, in the event of a conflict. Since
+ // we don't know the mesh id yet, we can't guarantee that
+ // joint offsets will be applied with the same priority as
+ // in the uploaded model. If the file contains multiple
+ // meshes with conflicting joint offsets, preview may be
+ // incorrect.
+ LLUUID fake_mesh_id;
+ fake_mesh_id.generate();
+
//Set the joint translations on the avatar
JointMap :: const_iterator masterJointIt = mJointMap.begin();
JointMap :: const_iterator masterJointItEnd = mJointMap.end();
@@ -1393,19 +1403,16 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
LLJoint* pJoint = mJointLookupFunc(lookingForJoint,mOpaqueData);
if ( pJoint )
{
- // FIXME: mesh_id is used to determine which
- // mesh gets to set the joint offset, in the
- // event of a conflict. Since we don't know
- // the mesh id yet, we can't guarantee that
- // joint offsets will be applied with the same
- // priority as in the uploaded model. If the
- // file contains multiple meshes with
- // conflicting joint offsets, preview may be
- // incorrect.
- LLUUID fake_mesh_id;
- fake_mesh_id.generate();
- bool dummy; // not used
- pJoint->addAttachmentPosOverride( jointTransform.getTranslation(), fake_mesh_id, "", dummy);
+ const LLVector3& joint_pos = jointTransform.getTranslation();
+ if (pJoint->aboveJointPosThreshold(joint_pos))
+ {
+ bool override_changed; // not used
+ pJoint->addAttachmentPosOverride(joint_pos, fake_mesh_id, "", override_changed);
+ if (model->mSkinInfo.mLockScaleIfJointPosition)
+ {
+ pJoint->addAttachmentScaleOverride(pJoint->getDefaultScale(), fake_mesh_id, "");
+ }
+ }
}
else
{