summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-10-01 11:05:29 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-10-01 11:05:29 -0400
commitebad0c6868b924ba607a1b2256ae7621cab62bf4 (patch)
tree76da7036c250158a3907b613f7ef89c66c5d3366 /indra/newview
parentfc74e02cde9b7b31de157f23a8bd9bf27a756428 (diff)
DRTVWR-412 WIP - more work for importer merge from viewer-release
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp25
-rwxr-xr-xindra/newview/llfloatermodelpreview.h3
2 files changed, 27 insertions, 1 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index a64685f699..18a2729398 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1708,6 +1708,21 @@ void LLModelPreview::clearModel(S32 lod)
mScene[lod].clear();
}
+void LLModelPreview::getLegalJointNames(JointNameSet& legal_joint_names)
+{
+ // Get all standard skeleton joints from the preview avatar.
+ LLVOAvatar *av = getPreviewAvatar();
+ const LLVOAvatar::avatar_joint_list_t &skel = av->getSkeleton();
+ for (S32 i=0; i<skel.size(); i++)
+ {
+ LLAvatarJoint *joint = skel[i];
+ if (joint)
+ {
+ legal_joint_names.push_back(joint->getName());
+ }
+ }
+}
+
void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable_slm)
{
assert_main_thread();
@@ -1750,6 +1765,10 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
clearGLODGroup();
}
+
+ JointNameSet legal_joint_names;
+ getLegalJointNames(legal_joint_names);
+
mModelLoader = new LLDAELoader(
filename,
lod,
@@ -1760,6 +1779,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
this,
mJointTransformMap,
mJointsFromNode,
+ legal_joint_names,
gSavedSettings.getU32("ImporterModelLimit"));
if (force_disable_slm)
@@ -3689,6 +3709,11 @@ BOOL LLModelPreview::render()
}
}
+ if (regen)
+ {
+ genBuffers(mPreviewLOD, skin_weight);
+ }
+
if (!skin_weight)
{
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 7a518c798b..25c650a725 100755
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -259,6 +259,7 @@ public:
virtual BOOL needsRender() { return mNeedsUpdate; }
void setPreviewLOD(S32 lod);
void clearModel(S32 lod);
+ void getLegalJointNames(JointNameSet& legal_joint_names);
void loadModel(std::string filename, S32 lod, bool force_disable_slm = false);
void loadModelCallback(S32 lod);
void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false);
@@ -405,7 +406,7 @@ private:
bool mLastJointUpdate;
- JointSet mJointsFromNode;
+ JointNameSet mJointsFromNode;
JointTransformMap mJointTransformMap;
LLPointer<LLVOAvatar> mPreviewAvatar;