diff options
author | Dave Parks <davep@lindenlab.com> | 2010-10-12 17:05:33 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-10-12 17:05:33 -0500 |
commit | 6cbe04a1fb7ce5704c8a16f05a21940a134d6d4c (patch) | |
tree | 30053531369726ebecc13f28db4ee995f5da6cf8 /indra/newview | |
parent | 4fc7a221e12be5557d7df401c54b5688e8305b08 (diff) |
SH-320 Make "scale" spinner actually work and show dimensions of current model.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 15 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_model_preview.xml | 13 |
2 files changed, 20 insertions, 8 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 6365803554..1d325448c4 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -2168,6 +2168,10 @@ U32 LLModelPreview::calcResourceCost() mFMP->childSetTextArg(info_name[LLModel::LOD_PHYSICS], "[HULLS]", llformat("%d",num_hulls)); mFMP->childSetTextArg(info_name[LLModel::LOD_PHYSICS], "[POINTS]", llformat("%d",num_points)); mFMP->childSetTextArg("streaming cost", "[COST]", llformat("%.3f", streaming_cost)); + F32 scale = mFMP->childGetValue("debug scale").asReal(); + mFMP->childSetTextArg("dimensions", "[X]", llformat("%.3f", mPreviewScale[0]*scale)); + mFMP->childSetTextArg("dimensions", "[Y]", llformat("%.3f", mPreviewScale[1]*scale)); + mFMP->childSetTextArg("dimensions", "[Z]", llformat("%.3f", mPreviewScale[2]*scale)); updateStatusMessages(); @@ -2181,11 +2185,19 @@ void LLModelPreview::rebuildUploadData() //fill uploaddata instance vectors from scene data + F32 scale = mFMP->childGetValue("debug scale").asReal(); + + LLMatrix4 scale_mat; + scale_mat.initScale(LLVector3(scale, scale, scale)); + for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter) { //for each transform in scene + LLMatrix4 mat = iter->first; + mat *= scale_mat; + for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter) { //for each instance with said transform applied - LLModelInstance& instance = *model_iter; + LLModelInstance instance = *model_iter; LLModel* base_model = instance.mModel; @@ -2210,6 +2222,7 @@ void LLModelPreview::rebuildUploadData() } } + instance.mTransform = mat; mUploadData.push_back(instance); } } diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index e1d1a769da..c7433af226 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -172,18 +172,17 @@ <button bottom_delta="25" follows="bottom|left" height="20" label="Upload" left="15" name="ok_btn" width="125" tool_tip="Upload to simulator"/> - <text bottom_delta="20" left="15" follows="top|left" height="15" name="description_label" text_color="1 0.82 0.46 1"> + <text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="description_label" text_color="1 0.82 0.46 1"> (No charge for upload during First Look) </text> <text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="upload_message"> [MESSAGE] </text> - <text bottom_delta="45" left="15" follows="top|left" height="15" name="debug section"> - DEBUG: + <text bottom_delta="20" left="15" width="280" follows="top|left" height="15" name="streaming cost"> + Estimated Streaming Cost: [COST] </text> - <text bottom_delta="20" left="15" follows="top|left" height="15" name="streaming cost"> - Streaming Cost: [COST] + <spinner bottom_delta="20" label="Scale" left="15" width="120" name="debug scale" decimal_digits="3" increment="0.1" min_val="0" max_val="64" initial_value="1" tool_tip="Multiplier for incoming object scale. If incoming dimensions are very small or very large, modify this value to get dimensions into an acceptable range."/> + <text bottom_delta="30" left="15" width="280" follows="top|left" height="15" name="dimensions"> + Model Dimensions: [X]m x [Y]m x [Z]m </text> - <spinner bottom_delta="20" label="Scale" left="15" width="120" name="debug scale" decimal_digits="3" increment="1" min_val="0" max_val="64" initial_value="1" tool_tip="Scale to base streaming cost on."/> - </floater> |