From 85efb85acfa098998c0f1249320f7e08288efdfc Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 23 Aug 2023 11:06:53 +0200 Subject: SL-19299 Viewer crashes after change 'Pick a physics model:' dropdown --- indra/newview/llmodelpreview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llmodelpreview.cpp') diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 495153981b..519d11e2ad 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -270,6 +270,7 @@ void LLModelPreview::rebuildUploadData() { assert_main_thread(); + mDefaultPhysicsShapeP = NULL; mUploadData.clear(); mTextureSet.clear(); -- cgit v1.2.3 From beb6181863bbce18ff7f408014e02a1086bc9711 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 23 Aug 2023 07:13:43 +0200 Subject: SL-19299 Code formatting in modified files --- indra/newview/llmodelpreview.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/newview/llmodelpreview.cpp') diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 519d11e2ad..ab8fdd6716 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -248,7 +248,7 @@ void LLModelPreview::updateDimentionsAndOffsets() { accounted.insert(instance.mModel); - //update instance skin info for each lods pelvisZoffset + // update instance skin info for each lods pelvisZoffset for (int j = 0; jsecond.begin(); model_iter != iter->second.end();) - { //for each instance with said transform applied + { // for each instance with said transform applied LLModelInstance instance = *model_iter++; LLModel* base_model = instance.mModel; @@ -573,7 +573,7 @@ void LLModelPreview::rebuildUploadData() else if (getLoadState() == LLModelLoader::ERROR_MATERIALS || getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) { - // This is only valid for these two error types because they are + // This is only valid for these two error types because they are // only used inside rebuildUploadData() and updateStatusMessages() // updateStatusMessages() is called after rebuildUploadData() setLoadState(LLModelLoader::DONE); @@ -775,7 +775,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable // it tends to force the UI into strange checkbox options // which cannot be altered. - //only try to load from slm if viewer is configured to do so and this is the + //only try to load from slm if viewer is configured to do so and this is the //initial model load (not an LoD or physics shape) mModelLoader->mTrySLM = gSavedSettings.getBOOL("MeshImportUseSLM") && mUploadData.empty(); } @@ -861,12 +861,13 @@ void LLModelPreview::clearIncompatible(S32 lod) // Check if already started bool subscribe_for_generation = mLodsQuery.empty(); - + // Remove previously scheduled work mLodsQuery.clear(); LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance; - if (!fmp) return; + if (!fmp) + return; // Schedule new work for (S32 i = LLModel::LOD_HIGH; i >= 0; --i) @@ -1696,7 +1697,7 @@ F32 LLModelPreview::genMeshOptimizerPerFace(LLModel *base_model, LLModel *target ll_aligned_free_16(output_indices); ll_aligned_free_16(shadow_indices); - + if (size_new_indices < 3) { // At least one triangle is needed @@ -1881,7 +1882,7 @@ void LLModelPreview::genMeshOptimizerLODs(S32 which_lod, S32 meshopt_mode, U32 d { precise_ratio = genMeshOptimizerPerModel(base, target_model, indices_decimator, lod_error_threshold, MESH_OPTIMIZER_NO_UVS); } - + if (precise_ratio < 0 || (precise_ratio * allowed_ratio_drift < indices_decimator)) { // Try sloppy variant if normal one failed to simplify model enough. -- cgit v1.2.3