diff options
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llmodelpreview.h | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index a9e80ab5da..a1420fba17 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -529,6 +529,16 @@ void LLModelPreview::rebuildUploadData() LLFloaterModelPreview::addStringToLog(out, false); } } + if (!mLastSpecifiedPhysicsModelOriginalName.empty() && !lod_model && (i == LLModel::LOD_PHYSICS)) + { + // Despite the various strategies above, if we don't now have a physics model, we're going to end up with decomposition. + // That's ok, but in the case where someone supplied a physics file, that's probably not what they wanted. + std::ostringstream out; + out << "Reusing previously matched physics model " << mLastSpecifiedPhysicsModelOriginalName; + LL_INFOS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, false); + lod_model = mLastSpecifiedPhysicsP; + } if (lod_model) { @@ -1185,7 +1195,11 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) LL_WARNS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, false); } - + if (loaded_lod == LLModel::LOD_PHYSICS) + { + mLastSpecifiedPhysicsModelOriginalName = loaded_name; + mLastSpecifiedPhysicsP = mModel[loaded_lod][idx]; + } mModel[loaded_lod][idx]->mLabel = name; } } diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index 3664a27a72..5a9fc93879 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -217,6 +217,8 @@ private: LLVOAvatar* getPreviewAvatar(void) { return mPreviewAvatar; } // Count amount of original models, excluding sub-models static U32 countRootModels(LLModelLoader::model_list models); + LLModel* mLastSpecifiedPhysicsP{}; // As opposed to being found by name or LOD; + std::string mLastSpecifiedPhysicsModelOriginalName{""}; // Since the above will have it's label bashed. protected: friend class LLModelLoader; |