diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 25 | ||||
-rwxr-xr-x | indra/newview/llfloatermodelpreview.h | 3 |
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; |