summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-12-14 15:52:26 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-12-14 15:52:26 -0500
commit5f8110a68ed2fdfe70e2dbd7363f1194b0f3e67d (patch)
treea671f7f7a5e93a7fe63e200ede5467ecd26d8210 /indra
parent4351160958efa1c352e8af1ab3f48c1486ba9c5c (diff)
SH-439 FIX: track name requested in UI separately, so we can fall back to name from dae if needed
Diffstat (limited to 'indra')
-rwxr-xr-x[-rw-r--r--]indra/llprimitive/llmodel.cpp8
-rwxr-xr-x[-rw-r--r--]indra/llprimitive/llmodel.h4
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp9
-rwxr-xr-xindra/newview/llmeshrepository.cpp2
4 files changed, 20 insertions, 3 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index b486e17194..2a8505e16e 100644..100755
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1324,6 +1324,14 @@ LLModel* LLModel::loadModelFromDomMesh(domMesh *mesh)
return ret;
}
+std::string LLModel::getName() const
+{
+ if (!mRequestedLabel.empty())
+ return mRequestedLabel;
+ else
+ return mLabel;
+}
+
//static
LLSD LLModel::writeModel(
std::string filename,
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index b81bc662a0..9cc734ff59 100644..100755
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -100,6 +100,7 @@ public:
static LLModel* loadModelFromDae(std::string filename);
static LLModel* loadModelFromDomMesh(domMesh* mesh);
static std::string getElementLabel(daeElement* element);
+ std::string getName() const;
void appendFaces(LLModel* model, LLMatrix4& transform, LLMatrix4& normal_transform);
void appendFace(const LLVolumeFace& src_face, std::string src_material, LLMatrix4& mat, LLMatrix4& norm_mat);
@@ -185,7 +186,8 @@ public:
LLMatrix4 mBindShapeMatrix;
std::vector<LLMatrix4> mInvBindMatrix;
std::vector<LLMatrix4> mAlternateBindMatrix;
- std::string mLabel;
+ std::string mRequestedLabel; // name requested in UI, if any.
+ std::string mLabel; // name computed from dae.
LLVector3 mNormalizedScale;
LLVector3 mNormalizedTranslation;
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 7b71598b81..f763e9624f 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2127,7 +2127,10 @@ void LLModelPreview::rebuildUploadData()
mTextureSet.clear();
//fill uploaddata instance vectors from scene data
+
+ std::string requested_name = mFMP->getChild<LLUICtrl>("description_form")->getValue().asString();
+
LLSpinCtrl* scale_spinner = mFMP->getChild<LLSpinCtrl>("import_scale");
if (!scale_spinner)
@@ -2171,6 +2174,10 @@ void LLModelPreview::rebuildUploadData()
LLModelInstance instance = *model_iter;
LLModel* base_model = instance.mModel;
+ if (base_model)
+ {
+ base_model->mRequestedLabel = requested_name;
+ }
S32 idx = 0;
for (idx = 0; idx < mBaseModel.size(); ++idx)
@@ -4131,7 +4138,7 @@ void LLFloaterModelPreview::onBrowseLOD(void* data)
void LLFloaterModelPreview::onUpload(void* user_data)
{
LLFloaterModelPreview* mp = (LLFloaterModelPreview*) user_data;
-
+
mp->mModelPreview->rebuildUploadData();
gMeshRepo.uploadModel(mp->mModelPreview->mUploadData, mp->mModelPreview->mPreviewScale,
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 0ee0d8393e..4873eaeabd 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2920,7 +2920,7 @@ LLSD LLMeshUploadThread::createObject(LLModelInstance& instance)
object_params["pos"] = ll_sd_from_vector3(position + mOrigin);
object_params["rotation"] = ll_sd_from_quaternion(quat_rotation);
object_params["scale"] = ll_sd_from_vector3(scale);
- object_params["name"] = instance.mModel->mLabel;
+ object_params["name"] = instance.mModel->getName();
// load material from dae file
object_params["facelist"] = LLSD::emptyArray();