diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-09-02 16:44:57 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-09-02 16:44:57 -0400 |
commit | 34ced1aa2cc286db26e2866cfc7a53ef72d828a4 (patch) | |
tree | 7ae48b379e7e1916d9d22d390ad9466f7b255402 /indra/llprimitive/lldaeloader.cpp | |
parent | a2875ba53ec02235a0db5734264108c0f0898269 (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.cpp | 33 |
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 { |