summaryrefslogtreecommitdiff
path: root/indra/newview/llmodelpreview.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-03-01 13:21:16 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-03-01 13:41:42 +0200
commit97a103255e433629f13e2156aa307ca329cdcfc6 (patch)
treebf5de1cef5930647c4ab87a0cff7f88f0007832d /indra/newview/llmodelpreview.cpp
parent92c302d6fba687f0921544b278e22b698d058646 (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' (DRTVWR-557) into DRTVWR-546
# Conflicts: # autobuild.xml # doc/contributions.txt # indra/cmake/GLOD.cmake # indra/llcommon/tests/llprocess_test.cpp # indra/newview/VIEWER_VERSION.txt # indra/newview/lldrawpoolavatar.cpp # indra/newview/llfloatermodelpreview.cpp # indra/newview/llmodelpreview.cpp # indra/newview/llviewertexturelist.cpp # indra/newview/llvovolume.cpp # indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/llmodelpreview.cpp')
-rw-r--r--indra/newview/llmodelpreview.cpp75
1 files changed, 3 insertions, 72 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index 58cf2e4ab2..d3eb2dd4d4 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -221,27 +221,14 @@ LLModelPreview::~LLModelPreview()
}
}
-U32 LLModelPreview::calcResourceCost()
+void LLModelPreview::updateDimentionsAndOffsets()
{
assert_main_thread();
rebuildUploadData();
- //Upload skin is selected BUT check to see if the joints coming in from the asset were malformed.
- if (mFMP && mFMP->childGetValue("upload_skin").asBoolean())
- {
- bool uploadingJointPositions = mFMP->childGetValue("upload_joints").asBoolean();
- if (uploadingJointPositions && !isRigValidForJointPositionUpload())
- {
- mFMP->childDisable("ok_btn");
- }
- }
-
std::set<LLModel*> accounted;
- U32 num_points = 0;
- U32 num_hulls = 0;
- F32 debug_scale = mFMP ? mFMP->childGetValue("import_scale").asReal() : 1.f;
mPelvisZOffset = mFMP ? mFMP->childGetValue("pelvis_offset").asReal() : 3.0f;
if (mFMP && mFMP->childGetValue("upload_joints").asBoolean())
@@ -253,8 +240,6 @@ U32 LLModelPreview::calcResourceCost()
getPreviewAvatar()->addPelvisFixup(mPelvisZOffset, fake_mesh_id);
}
- F32 streaming_cost = 0.f;
- F32 physics_cost = 0.f;
for (U32 i = 0; i < mUploadData.size(); ++i)
{
LLModelInstance& instance = mUploadData[i];
@@ -263,11 +248,6 @@ U32 LLModelPreview::calcResourceCost()
{
accounted.insert(instance.mModel);
- LLModel::Decomposition& decomp =
- instance.mLOD[LLModel::LOD_PHYSICS] ?
- instance.mLOD[LLModel::LOD_PHYSICS]->mPhysics :
- instance.mModel->mPhysics;
-
//update instance skin info for each lods pelvisZoffset
for (int j = 0; j<LLModel::NUM_LODS; ++j)
{
@@ -276,58 +256,14 @@ U32 LLModelPreview::calcResourceCost()
instance.mLOD[j]->mSkinInfo.mPelvisOffset = mPelvisZOffset;
}
}
-
- std::stringstream ostr;
- LLSD ret = LLModel::writeModel(ostr,
- instance.mLOD[4],
- instance.mLOD[3],
- instance.mLOD[2],
- instance.mLOD[1],
- instance.mLOD[0],
- decomp,
- mFMP->childGetValue("upload_skin").asBoolean(),
- mFMP->childGetValue("upload_joints").asBoolean(),
- mFMP->childGetValue("lock_scale_if_joint_position").asBoolean(),
- TRUE,
- FALSE,
- instance.mModel->mSubmodelID);
-
- num_hulls += decomp.mHull.size();
- for (U32 i = 0; i < decomp.mHull.size(); ++i)
- {
- num_points += decomp.mHull[i].size();
- }
-
- //calculate streaming cost
- LLMatrix4 transformation = instance.mTransform;
-
- LLVector3 position = LLVector3(0, 0, 0) * transformation;
-
- LLVector3 x_transformed = LLVector3(1, 0, 0) * transformation - position;
- LLVector3 y_transformed = LLVector3(0, 1, 0) * transformation - position;
- LLVector3 z_transformed = LLVector3(0, 0, 1) * transformation - position;
- F32 x_length = x_transformed.normalize();
- F32 y_length = y_transformed.normalize();
- F32 z_length = z_transformed.normalize();
- LLVector3 scale = LLVector3(x_length, y_length, z_length);
-
- F32 radius = scale.length()*0.5f*debug_scale;
-
- LLMeshCostData costs;
- if (gMeshRepo.getCostData(ret, costs))
- {
- streaming_cost += costs.getRadiusBasedStreamingCost(radius);
- }
}
}
F32 scale = mFMP ? mFMP->childGetValue("import_scale").asReal()*2.f : 2.f;
- mDetailsSignal(mPreviewScale[0] * scale, mPreviewScale[1] * scale, mPreviewScale[2] * scale, streaming_cost, physics_cost);
+ mDetailsSignal((F32)(mPreviewScale[0] * scale), (F32)(mPreviewScale[1] * scale), (F32)(mPreviewScale[2] * scale));
updateStatusMessages();
-
- return (U32)streaming_cost;
}
void LLModelPreview::rebuildUploadData()
@@ -1944,8 +1880,6 @@ void LLModelPreview::genMeshOptimizerLODs(S32 which_lod, S32 meshopt_mode, U32 d
}
}
}
-
- mResourceCost = calcResourceCost();
}
void LLModelPreview::updateStatusMessages()
@@ -2782,9 +2716,8 @@ void LLModelPreview::update()
if (mDirty && mLodsQuery.empty())
{
mDirty = false;
- mResourceCost = calcResourceCost();
+ updateDimentionsAndOffsets();
refresh();
- updateStatusMessages();
}
}
@@ -3053,8 +2986,6 @@ BOOL LLModelPreview::render()
{
// auto enable weight upload if weights are present
// (note: all these UI updates need to be somewhere that is not render)
- mViewOption["show_skin_weight"] = true;
- skin_weight = true;
fmp->childSetValue("upload_skin", true);
mFirstSkinUpdate = false;
}