diff options
author | andreykproductengine <akleshchev@productengine.com> | 2015-05-14 19:11:53 +0300 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2015-05-14 19:11:53 +0300 |
commit | 9e2eca1a8c64bcc90f71870b034bccdd1fdd57ab (patch) | |
tree | 08f17907cb5263587170a938b45c42a568ea1112 /indra/llprimitive | |
parent | 4f236dd7e8d28a6a473344b1aa527ba4e37c8881 (diff) |
MAINT-5216 FIXED Error appears when trying to upload the model "instance test.dae"
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 6c040470b7..1cb80a5769 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -1931,17 +1931,35 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da badElement = true; } - std::string label = getLodlessLabel(instance_geo); + std::string label; + + if (model->mLabel.empty()) + { + label = getLodlessLabel(instance_geo); - llassert(!label.empty()); + llassert(!label.empty()); - if (model->mSubmodelID) + if (model->mSubmodelID) + { + label += (char)((int)'a' + model->mSubmodelID); + } + + model->mLabel = label + lod_suffix[mLod]; + } + else { - label +=(char)((int)'a' + model->mSubmodelID); + // Don't change model's name if possible, it will play havoc with scenes that already use said model. + size_t ext_pos = getSuffixPosition(model->mLabel); + if (ext_pos != -1) + { + label = model->mLabel.substr(0, ext_pos); + } + else + { + label = model->mLabel; + } } - model->mLabel = label + lod_suffix[mLod]; - mScene[transformation].push_back(LLModelInstance(model, label, transformation, materials)); stretch_extents(model, transformation, mExtents[0], mExtents[1], mFirstTransform); i++; |