From 50b9c63382121df879680cf43f5be6fc09686607 Mon Sep 17 00:00:00 2001 From: seth_productengine Date: Fri, 22 Jul 2011 22:40:18 +0300 Subject: SH-1868 WIP Added user-supplied metric data for uploading a model. The mesh category string selected by user within the model data and sent to the server during calculating the upload fee and upload requests. The accounting info and the upload permissions warning in the bottom left corner of the floater are temporarily made mutually exclusive. --- indra/newview/llfloatermodelpreview.cpp | 6 ++++++ indra/newview/llmeshrepository.cpp | 8 ++++++++ .../skins/default/xui/en/floater_model_preview.xml | 18 +++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e045cf6729..6c01f0c09a 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3098,6 +3098,7 @@ void LLModelPreview::rebuildUploadData() std::string requested_name = mFMP->getChild("description_form")->getValue().asString(); + std::string metric = mFMP->getChild("model_category_combo")->getValue().asString(); LLSpinCtrl* scale_spinner = mFMP->getChild("import_scale"); @@ -3159,6 +3160,7 @@ void LLModelPreview::rebuildUploadData() if (base_model) { base_model->mRequestedLabel = requested_name; + base_model->mMetric = metric; } S32 idx = 0; @@ -5593,6 +5595,10 @@ void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result) mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty()); getChild("warning_title")->setVisible(!mHasUploadPerm); getChild("warning_message")->setVisible(!mHasUploadPerm); + + // Hide the accounting info if upload is not permitted. + getChild("weights_text")->setVisible(mHasUploadPerm); + getChild("weights")->setVisible(mHasUploadPerm); } void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::string& reason) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 7ddc0db20d..b887842652 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1321,6 +1321,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) std::map mesh_index; std::string model_name; + std::string model_metric; S32 instance_num = 0; @@ -1342,6 +1343,11 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) model_name = data.mBaseModel->getName(); } + if (model_metric.empty()) + { + model_metric = data.mBaseModel->getMetric(); + } + std::stringstream ostr; LLModel::Decomposition& decomp = @@ -1455,6 +1461,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) if (model_name.empty()) model_name = "mesh model"; result["name"] = model_name; + if (model_metric.empty()) model_metric = "MUT_Other"; + result["metric"] = model_metric; result["asset_resources"] = res; dump_llsd_to_file(result,make_dump_name("whole_model_",dump_num)); diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 0b7b4c684c..bfa245cbc1 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -32,6 +32,22 @@ + + + What does this model represent? + + + + + + + + + + + Preview: @@ -96,7 +112,7 @@