summaryrefslogtreecommitdiff
path: root/indra/llprimitive
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
parent34ced1aa2cc286db26e2866cfc7a53ef72d828a4 (diff)
SL-395 - can enable/disable scale lock in mesh upload UI. Feature works.
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llmodel.cpp20
-rw-r--r--indra/llprimitive/llmodel.h10
2 files changed, 22 insertions, 8 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;
}
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index fe6ce148c4..c23d65bc8f 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -42,16 +42,17 @@ class domMesh;
class LLMeshSkinInfo
{
public:
+ LLMeshSkinInfo() { }
+ LLMeshSkinInfo(LLSD& data);
+ void fromLLSD(LLSD& data);
+ LLSD asLLSD(bool include_joints, bool lock_scale_if_joint_position) const;
+
LLUUID mMeshID;
std::vector<std::string> mJointNames;
std::vector<LLMatrix4> mInvBindMatrix;
std::vector<LLMatrix4> mAlternateBindMatrix;
std::vector<U32> mJointRemap;
- LLMeshSkinInfo() { }
- LLMeshSkinInfo(LLSD& data);
- void fromLLSD(LLSD& data);
- LLSD asLLSD(bool include_joints) const;
LLMatrix4 mBindShapeMatrix;
float mPelvisOffset;
bool mLockScaleIfJointPosition;
@@ -139,6 +140,7 @@ public:
const LLModel::Decomposition& decomp,
BOOL upload_skin,
BOOL upload_joints,
+ BOOL lock_scale_if_joint_position,
BOOL nowrite = FALSE,
BOOL as_slm = FALSE,
int submodel_id = 0);