summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-03-13 18:11:48 +0200
committerandreykproductengine <akleshchev@productengine.com>2015-03-13 18:11:48 +0200
commit84b178ccb140b44a48805ed08468c6dc4acbc395 (patch)
treec1de5016cad50d91a25c82480510d3518ed60929
parent40dbdb9b38f9f9a1470c24ab0d98a96ad89cc686 (diff)
MAINT-4982 FIXED Multi-Material Mesh Issues
-rw-r--r--indra/llprimitive/lldaeloader.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index 50bf03b32f..373c67f063 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -2271,11 +2271,30 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& mo
models_out.clear();
- LLModel* ret = new LLModel(volume_params, 0.f);
+ LLModel* ret = new LLModel(volume_params, 0.f);
+
+ std::string model_name = getElementLabel(mesh);
+ ret->mLabel = model_name;
+
+ llassert(!ret->mLabel.empty());
- ret->mLabel = getElementLabel(mesh);
+ // extract actual name and suffix for future use in submodels
+ std::string name_base, name_suffix;
+ size_t ext_pos = model_name.find("_LOD");
+ if (ext_pos == -1)
+ {
+ ext_pos = model_name.find("_PHYS");
+ }
- llassert(!ret->mLabel.empty());
+ if (ext_pos == -1)
+ {
+ name_base = model_name;
+ }
+ else
+ {
+ name_base = model_name.substr(0, ext_pos);
+ name_suffix = model_name.substr(ext_pos, model_name.length() - ext_pos);
+ }
// Like a monkey, ready to be shot into space
//
@@ -2324,6 +2343,7 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& mo
{
LLModel* next = new LLModel(volume_params, 0.f);
next->mSubmodelID = ++submodelID;
+ next->mLabel = name_base + (char)((int)'a' + next->mSubmodelID) + name_suffix;
next->getVolumeFaces() = remainder;
next->mNormalizedScale = ret->mNormalizedScale;
next->mNormalizedTranslation = ret->mNormalizedTranslation;