From 5f8110a68ed2fdfe70e2dbd7363f1194b0f3e67d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 14 Dec 2010 15:52:26 -0500 Subject: SH-439 FIX: track name requested in UI separately, so we can fall back to name from dae if needed --- indra/llprimitive/llmodel.cpp | 8 ++++++++ indra/llprimitive/llmodel.h | 4 +++- indra/newview/llfloatermodelpreview.cpp | 9 ++++++++- indra/newview/llmeshrepository.cpp | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) mode change 100644 => 100755 indra/llprimitive/llmodel.cpp mode change 100644 => 100755 indra/llprimitive/llmodel.h (limited to 'indra') diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp old mode 100644 new mode 100755 index b486e17194..2a8505e16e --- 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 old mode 100644 new mode 100755 index b81bc662a0..9cc734ff59 --- 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 mInvBindMatrix; std::vector 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("description_form")->getValue().asString(); + LLSpinCtrl* scale_spinner = mFMP->getChild("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(); -- cgit v1.2.3