summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodelloader.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-02-10 19:48:45 +0200
committerandreykproductengine <akleshchev@productengine.com>2015-02-10 19:48:45 +0200
commit5a455a53e6454afa1127c89054658d8eb833b9e3 (patch)
tree6456d8b7a33cee1e37e36031a62aba8fd9834c18 /indra/llprimitive/llmodelloader.cpp
parent46101abd7348cdf386f58321c9e372b0c56983fd (diff)
MAINT-4813 FIXED "failed to upload: MAV_BLOCK_MISSING" appears when try to upload a large mesh
Diffstat (limited to 'indra/llprimitive/llmodelloader.cpp')
-rw-r--r--indra/llprimitive/llmodelloader.cpp37
1 files changed, 28 insertions, 9 deletions
diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp
index 677e4fcb37..c99c24585a 100644
--- a/indra/llprimitive/llmodelloader.cpp
+++ b/indra/llprimitive/llmodelloader.cpp
@@ -357,14 +357,6 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
return false;
}
- // Set name.
- std::string name = data["name"];
- if (!name.empty())
- {
- model[LLModel::LOD_HIGH][0]->mLabel = name;
- }
-
-
//load instance list
model_instance_list instance_list;
@@ -377,6 +369,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
//match up model instance pointers
S32 idx = instance_list[i].mLocalMeshID;
+ std::string instance_label = instance_list[i].mLabel;
for (U32 lod = 0; lod < LLModel::NUM_LODS; ++lod)
{
@@ -394,13 +387,39 @@ bool LLModelLoader::loadFromSLM(const std::string& filename)
}
continue;
}
+
+ if (model[lod][idx]
+ && model[lod][idx]->mLabel.empty()
+ && !instance_label.empty())
+ {
+ // restore model names
+ std::string name = instance_label;
+ switch (lod)
+ {
+ case LLModel::LOD_IMPOSTOR: name += "_LOD0"; break;
+ case LLModel::LOD_LOW: name += "_LOD1"; break;
+ case LLModel::LOD_MEDIUM: name += "_LOD2"; break;
+ case LLModel::LOD_PHYSICS: name += "_PHYS"; break;
+ case LLModel::LOD_HIGH: break;
+ }
+ model[lod][idx]->mLabel = name;
+ }
+
instance_list[i].mLOD[lod] = model[lod][idx];
}
}
if (!instance_list[i].mModel)
instance_list[i].mModel = model[LLModel::LOD_HIGH][idx];
- }
+ }
+
+ // Set name.
+ std::string name = data["name"];
+ if (!name.empty() && model[LLModel::LOD_HIGH][0]->mLabel.empty())
+ {
+ // fall back value, should be reset later by names from instances
+ model[LLModel::LOD_HIGH][0]->mLabel = name;
+ }
//convert instance_list to mScene