summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 23c5b7192d..851e2d2eb7 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3800,11 +3800,8 @@ void LLModelPreview::loadModelCallback(S32 lod)
mFMP->getChild<LLCheckBoxCtrl>("confirm_checkbox")->set(FALSE);
if (!mBaseModel.empty())
{
- if (mFMP->getChild<LLUICtrl>("description_form")->getValue().asString().empty())
- {
- const std::string& model_name = mBaseModel[0]->getName();
- mFMP->getChild<LLUICtrl>("description_form")->setValue(model_name);
- }
+ const std::string& model_name = mBaseModel[0]->getName();
+ mFMP->getChild<LLUICtrl>("description_form")->setValue(model_name);
}
}
refresh();
@@ -4844,7 +4841,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
LLModel* base_mdl = *base_iter;
base_iter++;
- for (S32 i = 0; i < mdl->getNumVolumeFaces(); ++i)
+ for (S32 i = 0, e = mdl->getNumVolumeFaces(); i < e; ++i)
{
const LLVolumeFace &vf = mdl->getVolumeFace(i);
U32 num_vertices = vf.mNumVertices;
@@ -5128,8 +5125,11 @@ BOOL LLModelPreview::render()
mViewOption["show_skin_weight"] = false;
fmp->disableViewOption("show_skin_weight");
fmp->disableViewOption("show_joint_positions");
+
+ skin_weight = false;
+ mFMP->childSetValue("show_skin_weight", false);
+ fmp->setViewOptionEnabled("show_skin_weight", skin_weight);
}
- skin_weight = false;
}
if (upload_skin && !has_skin_weights)
@@ -5233,6 +5233,16 @@ BOOL LLModelPreview::render()
const LLVertexBuffer* buff = vb_vec[0];
regen = buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) != skin_weight;
}
+ else
+ {
+ LL_INFOS(" ") << "Vertex Buffer[" << mPreviewLOD << "]" << " is EMPTY!!!" << LL_ENDL;
+ regen = TRUE;
+ }
+ }
+
+ if (regen)
+ {
+ genBuffers(mPreviewLOD, skin_weight);
}
//make sure material lists all match
@@ -5253,11 +5263,6 @@ BOOL LLModelPreview::render()
}
}
- if (regen)
- {
- genBuffers(mPreviewLOD, skin_weight);
- }
-
if (!skin_weight)
{
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
@@ -5276,7 +5281,7 @@ BOOL LLModelPreview::render()
gGL.multMatrix((GLfloat*) mat.mMatrix);
- for (U32 i = 0; i < mVertexBuffer[mPreviewLOD][model].size(); ++i)
+ for (U32 i = 0, e = mVertexBuffer[mPreviewLOD][model].size(); i < e; ++i)
{
LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i];
@@ -5551,7 +5556,7 @@ BOOL LLModelPreview::render()
if (!model->mSkinWeights.empty())
{
- for (U32 i = 0; i < mVertexBuffer[mPreviewLOD][model].size(); ++i)
+ for (U32 i = 0, e = mVertexBuffer[mPreviewLOD][model].size(); i < e; ++i)
{
LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i];
@@ -5620,6 +5625,7 @@ BOOL LLModelPreview::render()
position[j] = v;
}
+ llassert(model->mMaterialList.size() > i);
const std::string& binding = instance.mModel->mMaterialList[i];
const LLImportMaterial& material = instance.mMaterial[binding];