summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-07-06 19:27:43 -0500
committerDave Parks <davep@lindenlab.com>2011-07-06 19:27:43 -0500
commit9b253ccf68718dea51dc94416b3ece28b42fc32a (patch)
tree74639cf7e73c17d28222a95e4d44728eaa78ee0d
parent71eb68a85d5a5157622ae8f42bac1c21f00d54cd (diff)
SH-1972 Fix for slm messing up physics shape on second upload.
-rw-r--r--indra/llprimitive/llmodel.cpp7
-rw-r--r--indra/llprimitive/llmodel.h3
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp8
3 files changed, 7 insertions, 11 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 34b81c9672..d3f42c63d5 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1347,7 +1347,8 @@ LLSD LLModel::writeModel(
const LLModel::Decomposition& decomp,
BOOL upload_skin,
BOOL upload_joints,
- BOOL nowrite)
+ BOOL nowrite,
+ BOOL as_slm)
{
LLSD mdl;
@@ -1371,8 +1372,8 @@ LLSD LLModel::writeModel(
!decomp.mHull.empty())
{
mdl["physics_convex"] = decomp.asLLSD();
- if (!decomp.mHull.empty())
- { //convex decomposition exists, physics mesh will not be used
+ if (!decomp.mHull.empty() && !as_slm)
+ { //convex decomposition exists, physics mesh will not be used (unless this is an slm file)
model[LLModel::LOD_PHYSICS] = NULL;
}
}
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index cd9f76fcb7..1ece877f0f 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -137,7 +137,8 @@ public:
const LLModel::Decomposition& decomp,
BOOL upload_skin,
BOOL upload_joints,
- BOOL nowrite = FALSE);
+ BOOL nowrite = FALSE,
+ BOOL as_slm = FALSE);
static LLSD writeModelToStream(
std::ostream& ostr,
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index a452bcebb2..ab370a221f 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2034,12 +2034,6 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
return false;
}
- if (model[LLModel::LOD_PHYSICS].empty())
- { //no explicit physics block, copy HIGH_LOD into physics array to recover convex decomp
- model[LLModel::LOD_PHYSICS] = model[LLModel::LOD_HIGH];
- }
-
-
//load instance list
model_instance_list instance_list;
@@ -3248,7 +3242,7 @@ void LLModelPreview::saveUploadData(const std::string& filename, bool save_skinw
instance.mLOD[LLModel::LOD_LOW],
instance.mLOD[LLModel::LOD_IMPOSTOR],
decomp,
- save_skinweights, save_joint_positions);
+ save_skinweights, save_joint_positions, FALSE, TRUE);
data["mesh"][instance.mModel->mLocalID] = str.str();