summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-08-17 16:31:28 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-08-17 16:31:28 -0400
commit72d5ff36f56c4afee85f5863f64f237980341014 (patch)
tree3afd0fa622ad507e087d7b5b2d6724a71119cbec /indra/newview
parent9044a8b8156e5812f99c39d35be096a35df8f6d0 (diff)
MAINT-6647 - ignore previously created slm files on model upload. SL-442 - change coloring for show bones, to highlight joint positions and rigging
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llface.cpp1
-rw-r--r--indra/newview/llfloatermodelpreview.cpp17
-rw-r--r--indra/newview/llfloatermodelpreview.h4
-rw-r--r--indra/newview/llvoavatar.cpp31
4 files changed, 32 insertions, 21 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index de349a03d4..424bc0228c 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -573,6 +573,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
LLRiggedVolume* rigged = volume->getRiggedVolume();
if (rigged)
{
+ // BENTO - called when selecting a face during edit of a mesh object
LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.f, -1.f);
gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix);
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0f0fafcce6..1fd2d429a7 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1656,12 +1656,11 @@ void LLModelPreview::saveUploadData(bool save_skinweights, bool save_joint_posit
if (!mLODFile[LLModel::LOD_HIGH].empty())
{
std::string filename = mLODFile[LLModel::LOD_HIGH];
-
- std::string::size_type i = filename.rfind(".");
- if (i != std::string::npos)
- {
- filename.replace(i, filename.size()-1, ".slm");
- saveUploadData(filename, save_skinweights, save_joint_positions);
+ std::string slm_filename;
+
+ if (LLModelLoader::getSLMFilename(filename, slm_filename))
+ {
+ saveUploadData(slm_filename, save_skinweights, save_joint_positions);
}
}
}
@@ -1818,6 +1817,12 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
}
else
{
+ // For MAINT-6647, we have set force_disable_slm to true,
+ // which means this code path will never be taken. Trying to
+ // re-use SLM files has never worked properly; in particular,
+ // it tends to force the UI into strange checkbox options
+ // which cannot be altered.
+
//only try to load from slm if viewer is configured to do so and this is the
//initial model load (not an LoD or physics shape)
mModelLoader->mTrySLM = gSavedSettings.getBOOL("MeshImportUseSLM") && mUploadData.empty();
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 217ac35888..c4e42c76bd 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -106,7 +106,7 @@ public:
void refresh();
void loadModel(S32 lod);
- void loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false);
+ void loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = true);
void onViewOptionChecked(LLUICtrl* ctrl);
bool isViewOptionChecked(const LLSD& userdata);
@@ -261,7 +261,7 @@ public:
void setPreviewLOD(S32 lod);
void clearModel(S32 lod);
void getJointAliases(JointMap& joint_map);
- void loadModel(std::string filename, S32 lod, bool force_disable_slm = false);
+ void loadModel(std::string filename, S32 lod, bool force_disable_slm = true);
void loadModelCallback(S32 lod);
bool lodsReady() { return !mGenLOD && mLodsQuery.empty(); }
void queryLODs() { mGenLOD = true; };
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index db0316ebcd..946db6713e 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1428,12 +1428,15 @@ void LLVOAvatar::renderBones()
avatar_joint_list_t::iterator iter = mSkeleton.begin();
avatar_joint_list_t::iterator end = mSkeleton.end();
- static LLVector3 BASE_COLOR_OCCLUDED(1.0f, 0.0f, 0.0f);
- static LLVector3 BASE_COLOR_VISIBLE(0.5f, 0.5f, 0.5f);
- static LLVector3 EXTENDED_COLOR_OCCLUDED(0.0f, 1.0f, 0.0f);
- static LLVector3 EXTENDED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f);
+ // For bones with position overrides defined
+ static LLVector3 OVERRIDE_COLOR_OCCLUDED(1.0f, 0.0f, 0.0f);
+ static LLVector3 OVERRIDE_COLOR_VISIBLE(0.5f, 0.5f, 0.5f);
+ // For bones which are rigged to by at least one attachment
static LLVector3 RIGGED_COLOR_OCCLUDED(0.0f, 1.0f, 1.0f);
static LLVector3 RIGGED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f);
+ // For bones not otherwise colored
+ static LLVector3 OTHER_COLOR_OCCLUDED(0.0f, 1.0f, 0.0f);
+ static LLVector3 OTHER_COLOR_VISIBLE(0.5f, 0.5f, 0.5f);
static F32 SPHERE_SCALEF = 0.001f;
@@ -1446,25 +1449,27 @@ void LLVOAvatar::renderBones()
}
jointp->updateWorldMatrix();
- LLJoint::SupportCategory sc = jointp->getSupport();
+
LLVector3 occ_color, visible_color;
- if (jointIsRiggedTo(jointp->getName()))
+ LLVector3 pos;
+ LLUUID mesh_id;
+ if (jointp->hasAttachmentPosOverride(pos,mesh_id))
{
- occ_color = RIGGED_COLOR_OCCLUDED;
- visible_color = RIGGED_COLOR_VISIBLE;
+ occ_color = OVERRIDE_COLOR_OCCLUDED;
+ visible_color = OVERRIDE_COLOR_VISIBLE;
}
else
{
- if (sc == LLJoint::SUPPORT_BASE)
+ if (jointIsRiggedTo(jointp->getName()))
{
- occ_color = BASE_COLOR_OCCLUDED;
- visible_color = BASE_COLOR_VISIBLE;
+ occ_color = RIGGED_COLOR_OCCLUDED;
+ visible_color = RIGGED_COLOR_VISIBLE;
}
else
{
- occ_color = EXTENDED_COLOR_OCCLUDED;
- visible_color = EXTENDED_COLOR_VISIBLE;
+ occ_color = OTHER_COLOR_OCCLUDED;
+ visible_color = OTHER_COLOR_VISIBLE;
}
}
LLVector3 begin_pos(0,0,0);