Merge LL Viewer 3.8.4
commit
beacf09b41
1
.hgtags
1
.hgtags
|
|
@ -539,3 +539,4 @@ d07f76c5b9860fb87924d00ca729f7d4532534d6 3.7.29-release
|
|||
3f61ed662347dc7c6941b8266e72746a66d90e2a 3.8.1-release
|
||||
3a62616f3dd8bd512fcdfd29ef033b2505b11213 3.8.2-release
|
||||
60572f718879f786f6bc8b5c9373ebebf4693078 3.8.3-release
|
||||
27e3cf444c4cc645884960a61325a9ee0e9a2d0f 3.8.4-release
|
||||
|
|
|
|||
|
|
@ -209,6 +209,15 @@ LLViewerFetchedTexture* bindMaterialDiffuseTexture(const LLImportMaterial& mater
|
|||
return NULL;
|
||||
}
|
||||
|
||||
std::string stripSuffix(std::string name)
|
||||
{
|
||||
if ((name.find("_LOD") != -1) || (name.find("_PHYS") != -1))
|
||||
{
|
||||
return name.substr(0, name.rfind('_'));
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
LLMeshFilePicker::LLMeshFilePicker(LLModelPreview* mp, S32 lod)
|
||||
// <FS:CR> Threaded Filepickers
|
||||
//: LLFilePickerThread(LLFilePicker::FFLOAD_COLLADA)
|
||||
|
|
@ -2048,6 +2057,83 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
|
|||
mBaseScene = mScene[loaded_lod];
|
||||
mVertexBuffer[5].clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOL importerDebug = gSavedSettings.getBOOL("ImporterDebug");
|
||||
BOOL legacyMatching = gSavedSettings.getBOOL("ImporterLegacyMatching");
|
||||
if (!legacyMatching)
|
||||
{
|
||||
if (!mBaseModel.empty())
|
||||
{
|
||||
BOOL name_based = FALSE;
|
||||
BOOL has_submodels = FALSE;
|
||||
for (U32 idx = 0; idx < mBaseModel.size(); ++idx)
|
||||
{
|
||||
if (mBaseModel[idx]->mSubmodelID)
|
||||
{ // don't do index-based renaming when the base model has submodels
|
||||
has_submodels = TRUE;
|
||||
if (importerDebug)
|
||||
{
|
||||
LL_INFOS() << "High LOD has submodels" << LL_ENDL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (U32 idx = 0; idx < mModel[loaded_lod].size(); ++idx)
|
||||
{
|
||||
std::string loaded_name = stripSuffix(mModel[loaded_lod][idx]->mLabel);
|
||||
|
||||
LLModel* found_model = NULL;
|
||||
LLMatrix4 transform;
|
||||
FindModel(mBaseScene, loaded_name, found_model, transform);
|
||||
if (found_model)
|
||||
{ // don't rename correctly named models (even if they are placed in a wrong order)
|
||||
name_based = TRUE;
|
||||
}
|
||||
|
||||
if (mModel[loaded_lod][idx]->mSubmodelID)
|
||||
{ // don't rename the models when loaded LOD model has submodels
|
||||
has_submodels = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (importerDebug)
|
||||
{
|
||||
LL_INFOS() << "Loaded LOD " << loaded_lod << ": correct names" << (name_based ? "" : "NOT ") << "found; submodels " << (has_submodels ? "" : "NOT ") << "found" << LL_ENDL;
|
||||
}
|
||||
|
||||
if (!name_based && !has_submodels)
|
||||
{ // replace the name of the model loaded for any non-HIGH LOD to match the others (MAINT-5601)
|
||||
// this actually works like "ImporterLegacyMatching" for this particular LOD
|
||||
for (U32 idx = 0; idx < mModel[loaded_lod].size() && idx < mBaseModel.size(); ++idx)
|
||||
{
|
||||
std::string name = mBaseModel[idx]->mLabel;
|
||||
std::string loaded_name = stripSuffix(mModel[loaded_lod][idx]->mLabel);
|
||||
|
||||
if (loaded_name != name)
|
||||
{
|
||||
switch (loaded_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;
|
||||
}
|
||||
|
||||
if (importerDebug)
|
||||
{
|
||||
LL_WARNS() << "Loded model name " << mModel[loaded_lod][idx]->mLabel << " for LOD " << loaded_lod << " doesn't match the base model. Renaming to " << name << LL_ENDL;
|
||||
}
|
||||
|
||||
mModel[loaded_lod][idx]->mLabel = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clearIncompatible(loaded_lod);
|
||||
|
||||
|
|
@ -3854,7 +3940,7 @@ BOOL LLModelPreview::render()
|
|||
genBuffers(LLModel::LOD_PHYSICS, false);
|
||||
}
|
||||
|
||||
U32 num_models = mVertexBuffer[mPreviewLOD][model].size();
|
||||
U32 num_models = mVertexBuffer[LLModel::LOD_PHYSICS][model].size();
|
||||
for (U32 i = 0; i < num_models; ++i)
|
||||
{
|
||||
LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
|
||||
|
|
|
|||
Loading…
Reference in New Issue