From e0bf0e3e2150304e7b26c18c274273c18653965b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 17 Aug 2011 14:59:22 -0500 Subject: SH-2217 Fix for large models not getting properly clampled by importer (odd that server seems to need 240m limit instead of 256m limit) --- indra/newview/llfloatermodelpreview.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 0ce8dcd46b..0c8fd33113 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3173,11 +3173,6 @@ void LLModelPreview::rebuildUploadData() LLSpinCtrl* scale_spinner = mFMP->getChild("import_scale"); - if (!scale_spinner) - { - llerrs << "floater_model_preview.xml MUST contain import_scale spinner." << llendl; - } - F32 scale = scale_spinner->getValue().asReal(); LLMatrix4 scale_mat; @@ -3262,7 +3257,14 @@ void LLModelPreview::rebuildUploadData() } } - F32 max_import_scale = DEFAULT_MAX_PRIM_SCALE/max_scale; + F32 max_import_scale = (DEFAULT_MAX_PRIM_SCALE-0.1f)/max_scale; + + F32 max_axis = llmax(mPreviewScale.mV[0], mPreviewScale.mV[1]); + max_axis = llmax(max_axis, mPreviewScale.mV[2]); + max_axis *= 2.f; + + //clamp scale so that total imported model bounding box is smaller than 240m on a side + max_import_scale = llmin(max_import_scale, 240.f/max_axis); scale_spinner->setMaxValue(max_import_scale); -- cgit v1.2.3