summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodel.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-09-06 16:32:41 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-09-06 16:32:41 -0400
commit6c46b3caf20af1a2987c0ca4ed0bf8e6ebe80fb4 (patch)
treed95992612ca2436602257f7c6515e91394e1142a /indra/llprimitive/llmodel.cpp
parent34ced1aa2cc286db26e2866cfc7a53ef72d828a4 (diff)
SL-395 - can enable/disable scale lock in mesh upload UI. Feature works.
Diffstat (limited to 'indra/llprimitive/llmodel.cpp')
-rw-r--r--indra/llprimitive/llmodel.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index cd9e5cfa54..6637f41966 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -671,6 +671,7 @@ LLSD LLModel::writeModel(
const LLModel::Decomposition& decomp,
BOOL upload_skin,
BOOL upload_joints,
+ BOOL lock_scale_if_joint_position,
BOOL nowrite,
BOOL as_slm,
int submodel_id)
@@ -690,7 +691,7 @@ LLSD LLModel::writeModel(
if (skinning)
{ //write skinning block
- mdl["skin"] = high->mSkinInfo.asLLSD(upload_joints);
+ mdl["skin"] = high->mSkinInfo.asLLSD(upload_joints, lock_scale_if_joint_position);
}
if (!decomp.mBaseHull.empty() ||
@@ -1451,11 +1452,17 @@ void LLMeshSkinInfo::fromLLSD(LLSD& skin)
mPelvisOffset = skin["pelvis_offset"].asReal();
}
- // FIXME BENTO check contents of asset.
- mLockScaleIfJointPosition = true;
+ if (skin.has("lock_scale_if_joint_position"))
+ {
+ mLockScaleIfJointPosition = skin["lock_scale_if_joint_position"].asBoolean();
+ }
+ else
+ {
+ mLockScaleIfJointPosition = false;
+ }
}
-LLSD LLMeshSkinInfo::asLLSD(bool include_joints) const
+LLSD LLMeshSkinInfo::asLLSD(bool include_joints, bool lock_scale_if_joint_position) const
{
LLSD ret;
@@ -1493,6 +1500,11 @@ LLSD LLMeshSkinInfo::asLLSD(bool include_joints) const
}
}
+ if (lock_scale_if_joint_position)
+ {
+ ret["lock_scale_if_joint_position"] = mLockScaleIfJointPosition;
+ }
+
ret["pelvis_offset"] = mPelvisOffset;
}