From 57a7f63dcce6eb20a05dbc42bfdc9ac51072cb7e Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 4 Feb 2022 09:55:05 -0800 Subject: SL-98 - Render a "ground plane" in the model upload preview, so users can see any added offset --- indra/newview/llmodelpreview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmodelpreview.cpp') diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index a9e80ab5da..88ef88d297 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3404,7 +3404,10 @@ BOOL LLModelPreview::render() { gDebugProgram.bind(); } - getPreviewAvatar()->renderCollisionVolumes(); + if (fmp->mTabContainer->getCurrentPanelIndex() == fmp->mPhysicsTabIndex) + { // Physics collision volumes obscure a lot, so only show them when on the physics tab. + getPreviewAvatar()->renderCollisionVolumes(); + } if (fmp->mTabContainer->getCurrentPanelIndex() == fmp->mAvatarTabIndex) { getPreviewAvatar()->renderBones(fmp->mSelectedJointName); @@ -3413,6 +3416,7 @@ BOOL LLModelPreview::render() { getPreviewAvatar()->renderBones(); } + getPreviewAvatar()->renderGroundPlane(mPelvisZOffset); if (shader) { shader->bind(); -- cgit v1.2.3 From f1df486208f94c649f09dc2dc0cce393208d3771 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 4 Feb 2022 13:55:08 -0800 Subject: SL-98 - move new renderGroundPlane from LLVOAvatar to LLModelPreview --- indra/newview/llmodelpreview.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmodelpreview.cpp') diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 88ef88d297..8e487484fd 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3416,7 +3416,7 @@ BOOL LLModelPreview::render() { getPreviewAvatar()->renderBones(); } - getPreviewAvatar()->renderGroundPlane(mPelvisZOffset); + renderGroundPlane(mPelvisZOffset); if (shader) { shader->bind(); @@ -3441,6 +3441,39 @@ BOOL LLModelPreview::render() return TRUE; } +void LLModelPreview::renderGroundPlane(float z_offset) +{ // Not necesarilly general - beware - but it seems to meet the needs of LLModelPreview::render + const LLVOAvatar* avatarp = getPreviewAvatar(); + const LLVector3 root_pos = avatarp->mRoot->getPosition(); + const LLVector4a* ext = avatarp->mDrawable->getSpatialExtents(); + const LLVector4a min = ext[0], max = ext[1]; + const F32 center = (max[2] - min[2]) * 0.5f; + const F32 ground = root_pos[2] - center - z_offset; + + const LLVector3 vA{min[0], min[1], ground}; + const LLVector3 vB{max[0], min[1], ground}; + const LLVector3 vC{max[0], max[1], ground}; + const LLVector3 vD{min[0], max[1], ground}; + + gGL.diffuseColor3f( 1.0f, 0.0f, 1.0f ); + + gGL.begin(LLRender::LINES); + gGL.vertex3fv(vA.mV); + gGL.vertex3fv(vB.mV); + + gGL.vertex3fv(vB.mV); + gGL.vertex3fv(vC.mV); + + gGL.vertex3fv(vC.mV); + gGL.vertex3fv(vD.mV); + + gGL.vertex3fv(vD.mV); + gGL.vertex3fv(vA.mV); + + gGL.end(); +} + + //----------------------------------------------------------------------------- // refresh() //----------------------------------------------------------------------------- -- cgit v1.2.3 From ca43cc2305502ec4f6a8d75ea2e4303b655ff0ce Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 4 Feb 2022 14:13:19 -0800 Subject: SL-98 - Remove special new tab-specific display behavior --- indra/newview/llmodelpreview.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/newview/llmodelpreview.cpp') diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 8e487484fd..f12ddb1745 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3404,10 +3404,7 @@ BOOL LLModelPreview::render() { gDebugProgram.bind(); } - if (fmp->mTabContainer->getCurrentPanelIndex() == fmp->mPhysicsTabIndex) - { // Physics collision volumes obscure a lot, so only show them when on the physics tab. - getPreviewAvatar()->renderCollisionVolumes(); - } + getPreviewAvatar()->renderCollisionVolumes(); if (fmp->mTabContainer->getCurrentPanelIndex() == fmp->mAvatarTabIndex) { getPreviewAvatar()->renderBones(fmp->mSelectedJointName); -- cgit v1.2.3 From a5f06a1b8136f0cdfc520e94166de202f3925505 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 12 Feb 2022 23:12:36 +0200 Subject: SL-4488 Fixed ambiguity mapped weights to vertices in uploader Were not displaying and uploading correctly. --- indra/newview/llmodelpreview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llmodelpreview.cpp') diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index f12ddb1745..5ee236e07d 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -2400,7 +2400,6 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) continue; } - LLModel* base_mdl = *base_iter; base_iter++; S32 num_faces = mdl->getNumVolumeFaces(); @@ -2475,7 +2474,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) //find closest weight to vf.mVertices[i].mPosition LLVector3 pos(vf.mPositions[i].getF32ptr()); - const LLModel::weight_list& weight_list = base_mdl->getJointInfluences(pos); + const LLModel::weight_list& weight_list = mdl->getJointInfluences(pos); llassert(weight_list.size()>0 && weight_list.size() <= 4); // LLModel::loadModel() should guarantee this LLVector4 w(0, 0, 0, 0); -- cgit v1.2.3 From 5e89e26554bfb4668f63c82cb7d869c15cca79c5 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 9 Mar 2022 17:32:22 +0200 Subject: SL-16980 FIXED Uploading model preview disappeared after changing the Triangle limit --- 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 31eb00df40..039063c711 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3529,6 +3529,7 @@ void LLModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit) { genLODs(lod, 3, enforce_tri_limit); refresh(); + mDirty = true; } } -- cgit v1.2.3 From c58c308d2163db1040acabe5a85c3853ef4edb44 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 15 Mar 2022 16:13:24 +0200 Subject: SL-17002 FIXED The "include joint positions" checkbox is displayed inactive --- indra/newview/llmodelpreview.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llmodelpreview.cpp') diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 039063c711..0fddbd6326 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -2745,6 +2745,9 @@ BOOL LLModelPreview::render() // (note: all these UI updates need to be somewhere that is not render) fmp->childSetValue("upload_skin", true); mFirstSkinUpdate = false; + upload_skin = true; + skin_weight = true; + mViewOption["show_skin_weight"] = true; } fmp->enableViewOption("show_skin_weight"); -- cgit v1.2.3