From 5614f6cbf6867b0114a45aadbe1d975a3d71000c Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 29 Nov 2018 21:04:35 +0200 Subject: SL-9747 [Mesh Uploader] Remove confusing model_metric from upload --- indra/llprimitive/llmodel.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index cf3288489a..51fa2f8079 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -154,7 +154,6 @@ public: void ClearFacesAndMaterials() { mVolumeFaces.clear(); mMaterialList.clear(); } std::string getName() const; - std::string getMetric() const {return mMetric;} EModelStatus getStatus() const {return mStatus;} static std::string getStatusString(U32 status) ; @@ -260,8 +259,6 @@ public: std::string mRequestedLabel; // name requested in UI, if any. std::string mLabel; // name computed from dae. - std::string mMetric; // user-supplied metric data for upload - LLVector3 mNormalizedScale; LLVector3 mNormalizedTranslation; -- cgit v1.3 From 580b35c8ea59187d5197e712022b706df3655f86 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 1 Apr 2019 20:22:25 +0300 Subject: SL-307 Display in-viewer all warning messages logged by the mesh uploader --- indra/llprimitive/llmodelloader.cpp | 4 + indra/llprimitive/llmodelloader.h | 5 + indra/llui/lltabcontainer.cpp | 4 + indra/llui/lltabcontainer.h | 6 + indra/llui/lltextbase.cpp | 12 ++ indra/llui/lltextbase.h | 2 + indra/newview/llfloatermodelpreview.cpp | 126 ++++++++++++++++++--- indra/newview/llfloatermodelpreview.h | 9 +- .../skins/default/xui/en/floater_model_preview.xml | 39 ++++++- 9 files changed, 191 insertions(+), 16 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index 4e468ff45f..c8da68afc8 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -146,6 +146,7 @@ LLModelLoader::~LLModelLoader() void LLModelLoader::run() { + mWarningStream.clear(); doLoadModel(); doOnIdleOneTime(boost::bind(&LLModelLoader::loadModelCallback,this)); } @@ -426,6 +427,7 @@ bool LLModelLoader::isRigLegacy( const std::vector &jointListFromAs { LL_WARNS() << "Rigged to " << jointListFromAsset.size() << " joints, max is " << mMaxJointsPerMesh << LL_ENDL; LL_WARNS() << "Skinning disabled due to too many joints" << LL_ENDL; + mWarningStream << "Skinning disabled due to too many joints, maximum amount per mesh: " << mMaxJointsPerMesh << "\n"; return false; } @@ -437,12 +439,14 @@ bool LLModelLoader::isRigLegacy( const std::vector &jointListFromAs if (mJointMap.find(*it)==mJointMap.end()) { LL_WARNS() << "Rigged to unrecognized joint name " << *it << LL_ENDL; + mWarningStream << "Rigged to unrecognized joint name " << *it << "\n"; unknown_joint_count++; } } if (unknown_joint_count>0) { LL_WARNS() << "Skinning disabled due to unknown joints" << LL_ENDL; + mWarningStream << "Skinning disabled due to unknown joints\n"; return false; } diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index 643c45a6d8..8dde176b54 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -185,6 +185,9 @@ public: return name != NULL && mJointMap.find(name) != mJointMap.end(); } + std::string logOut() { return mWarningStream.str(); } + void clearLog() { mWarningStream.clear(); } + protected: LLModelLoader::load_callback_t mLoadCallback; @@ -201,6 +204,8 @@ protected: JointTransformMap mJointTransformMap; + std::ostringstream mWarningStream; // preview floater will pull logs from here + static std::list sActiveLoaderList; static bool isAlive(LLModelLoader* loader) ; }; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 1b2f09cff5..0af97bfab2 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -217,6 +217,7 @@ LLTabContainer::Params::Params() last_tab("last_tab"), use_custom_icon_ctrl("use_custom_icon_ctrl", false), open_tabs_on_drag_and_drop("open_tabs_on_drag_and_drop", false), + enable_tabs_flashing("enable_tabs_flashing", false), tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0), use_ellipses("use_ellipses"), font_halign("halign") @@ -1090,6 +1091,9 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.pad_left( mLabelPadLeft ); p.pad_right(2); } + + // inits flash timer + p.button_flash_enable = mEnableTabsFlashing; // *TODO : It seems wrong not to use p in both cases considering the way p is initialized if (mCustomIconCtrlUsed) diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 4a5f08f5d3..a8cf380333 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -109,6 +109,11 @@ public: * Open tabs on hover in drag and drop situations */ Optional open_tabs_on_drag_and_drop; + + /** + * Open tabs on hover in drag and drop situations + */ + Optional enable_tabs_flashing; /** * Paddings for LLIconCtrl in case of LLCustomButtonIconCtrl usage(use_custom_icon_ctrl = true) @@ -308,6 +313,7 @@ private: bool mCustomIconCtrlUsed; bool mOpenTabsOnDragAndDrop; + bool mEnableTabsFlashing; S32 mTabIconCtrlPad; bool mUseTabEllipses; }; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index c570285856..f4713e19ba 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2215,6 +2215,18 @@ void LLTextBase::needsReflow(S32 index) mReflowIndex = llmin(mReflowIndex, index); } +S32 LLTextBase::removeFirstLine() +{ + if (!mLineInfoList.empty()) + { + S32 length = getLineEnd(0); + deselect(); + removeStringNoUndo(0, length); + return length; + } + return 0; +} + void LLTextBase::appendLineBreakSegment(const LLStyle::Params& style_params) { segment_vec_t segments; diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 5fdde445ef..6913374bac 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -401,6 +401,7 @@ public: virtual void setText(const LLStringExplicit &utf8str , const LLStyle::Params& input_params = LLStyle::Params()); // uses default style virtual std::string getText() const; void setMaxTextLength(S32 length) { mMaxTextByteLength = length; } + S32 getMaxTextLength() { return mMaxTextByteLength; } // wide-char versions void setWText(const LLWString& text); @@ -429,6 +430,7 @@ public: S32 getLength() const { return getWText().length(); } S32 getLineCount() const { return mLineInfoList.size(); } + S32 removeFirstLine(); // returns removed length void addDocumentChild(LLView* view); void removeDocumentChild(LLView* view); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 8be405df9e..6387dfee55 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -76,6 +76,7 @@ #include "llsdserialize.h" #include "llsliderctrl.h" #include "llspinctrl.h" +#include "lltabcontainer.h" #include "lltoggleablemenu.h" #include "lltrans.h" #include "llvfile.h" @@ -83,6 +84,7 @@ #include "llcallbacklist.h" #include "llviewerobjectlist.h" #include "llanimationstates.h" +#include "llviewertexteditor.h" #include "llviewernetwork.h" #include "llviewershadermgr.h" @@ -263,7 +265,9 @@ void FindModel(LLModelLoader::scene& scene, const std::string& name_to_match, LL LLFloaterModelPreview::LLFloaterModelPreview(const LLSD& key) : LLFloaterModelUploadBase(key), mUploadBtn(NULL), -mCalculateBtn(NULL) +mCalculateBtn(NULL), +mUploadLogText(NULL), +mTabContainer(NULL) { sInstance = this; mLastMouseX = 0; @@ -392,6 +396,13 @@ BOOL LLFloaterModelPreview::postBuild() mUploadBtn = getChild("ok_btn"); mCalculateBtn = getChild("calculate_btn"); + mUploadLogText = getChild("log_text"); + mTabContainer = getChild("import_tab"); + + // Disable Logs tab untill it has something to show + LLPanel* panel = mTabContainer->getPanelByName("logs_panel"); + S32 index = mTabContainer->getIndexForPanel(panel); + mTabContainer->enableTabButton(index, false); if (LLConvexDecomposition::getInstance() != NULL) { @@ -1280,6 +1291,64 @@ void LLFloaterModelPreview::onMouseCaptureLostModelPreview(LLMouseHandler* handl gViewerWindow->showCursor(); } +//----------------------------------------------------------------------------- +// addStringToLog() +//----------------------------------------------------------------------------- +// static +void LLFloaterModelPreview::addStringToLog(const std::string& str, bool flash) +{ + if (sInstance) + { + sInstance->addStringToLogTab(str, flash); + } +} + +// static +void LLFloaterModelPreview::addStringToLog(const std::ostringstream& strm, bool flash) +{ + if (sInstance) + { + sInstance->addStringToLogTab(strm.str(), flash); + } +} + +//----------------------------------------------------------------------------- +// addStringToLogTab() +//----------------------------------------------------------------------------- +void LLFloaterModelPreview::addStringToLogTab(const std::string& str, bool flash) +{ + if (str.empty()) + { + return; + } + + LLWString text = utf8str_to_wstring(str); + S32 add_text_len = text.length() + 1; // newline + S32 editor_max_len = mUploadLogText->getMaxTextLength(); + if (add_text_len > editor_max_len) + { + return; + } + + LLPanel* panel = mTabContainer->getPanelByName("logs_panel"); + S32 index = mTabContainer->getIndexForPanel(panel); + mTabContainer->enableTabButton(index, true); + + // Make sure we have space for new string + S32 editor_text_len = mUploadLogText->getLength(); + while (editor_max_len < (editor_text_len + add_text_len)) + { + editor_text_len -= mUploadLogText->removeFirstLine(); + } + + mUploadLogText->appendText(str, true); + + if (flash && mTabContainer->getCurrentPanel() != panel) + { + mTabContainer->setTabPanelFlashing(panel, true); + } +} + //----------------------------------------------------------------------------- // LLModelPreview //----------------------------------------------------------------------------- @@ -1710,8 +1779,14 @@ void LLModelPreview::rebuildUploadData() LLQuaternion identity; if (!bind_rot.isEqualEps(identity,0.01)) { - LL_WARNS() << "non-identity bind shape rot. mat is " << high_lod_model->mSkinInfo.mBindShapeMatrix - << " bind_rot " << bind_rot << LL_ENDL; + std::ostringstream out; + out << "non-identity bind shape rot. mat is "; + out << high_lod_model->mSkinInfo.mBindShapeMatrix; + out << " bind_rot "; + out << bind_rot; + LL_WARNS() << out.str() << LL_ENDL; + + LLFloaterModelPreview::addStringToLog(out, false); setLoadState( LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION ); } } @@ -1882,7 +1957,11 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable if (lod < LLModel::LOD_IMPOSTOR || lod > LLModel::NUM_LODS - 1) { - LL_WARNS() << "Invalid level of detail: " << lod << LL_ENDL; + std::ostringstream out; + out << "Invalid level of detail: "; + out << lod; + LL_WARNS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, true); assert(lod >= LLModel::LOD_IMPOSTOR && lod < LLModel::NUM_LODS); return; } @@ -2259,7 +2338,12 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) if (importerDebug) { - LL_WARNS() << "Loded model name " << mModel[loaded_lod][idx]->mLabel << " for LOD " << loaded_lod << " doesn't match the base model. Renaming to " << name << LL_ENDL; + std::ostringstream out; + out << "Loded model name " << mModel[loaded_lod][idx]->mLabel; + out << " for LOD " << loaded_lod; + out << " doesn't match the base model. Renaming to " << name; + LL_WARNS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, false); } mModel[loaded_lod][idx]->mLabel = name; @@ -2417,7 +2501,10 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim // Allow LoD from -1 to LLModel::LOD_PHYSICS if (which_lod < -1 || which_lod > LLModel::NUM_LODS - 1) { - LL_WARNS() << "Invalid level of detail: " << which_lod << LL_ENDL; + std::ostringstream out; + out << "Invalid level of detail: " << which_lod; + LL_WARNS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, false); assert(which_lod >= -1 && which_lod < LLModel::NUM_LODS); return; } @@ -3288,7 +3375,10 @@ void LLModelPreview::updateLodControls(S32 lod) { if (lod < LLModel::LOD_IMPOSTOR || lod > LLModel::LOD_HIGH) { - LL_WARNS() << "Invalid level of detail: " << lod << LL_ENDL; + std::ostringstream out; + out << "Invalid level of detail: " << lod; + LL_WARNS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, false); assert(lod >= LLModel::LOD_IMPOSTOR && lod <= LLModel::LOD_HIGH); return; } @@ -3484,9 +3574,12 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) if (!vb->allocateBuffer(num_vertices, num_indices, TRUE)) { // We are likely to crash due this failure, if this happens, find a way to gracefully stop preview - LL_WARNS() << "Failed to allocate Vertex Buffer for model preview " - << num_vertices << " vertices and " - << num_indices << " indices" << LL_ENDL; + std::ostringstream out; + out << "Failed to allocate Vertex Buffer for model preview "; + out << num_vertices << " vertices and "; + out << num_indices << " indices"; + LL_WARNS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, true); } LLStrider vertex_strider; @@ -3634,8 +3727,11 @@ void LLModelPreview::loadedCallback( LLModelPreview* pPreview = static_cast< LLModelPreview* >(opaque); if (pPreview && !LLModelPreview::sIgnoreLoadedCallback) { - pPreview->loadModelCallback(lod); - } + LLFloaterModelPreview::addStringToLog(pPreview->mModelLoader->logOut(), true); + pPreview->mModelLoader->clearLog(); + pPreview->loadModelCallback(lod); // removes mModelLoader in some cases + } + } void LLModelPreview::stateChangedCallback(U32 state,void* opaque) @@ -4688,7 +4784,11 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived() void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) { - LL_WARNS() << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << LL_ENDL; + std::ostringstream out; + out << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status; + out << " : " << reason << ")"; + LL_WARNS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, false); doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true)); } diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 096544cdbf..c459b9296b 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -57,7 +57,9 @@ class domController; class domSkin; class domMesh; class LLMenuButton; +class LLTabContainer; class LLToggleableMenu; +class LLViewerTextEditor; class LLFloaterModelPreview : public LLFloaterModelUploadBase { @@ -93,6 +95,8 @@ public: static void onMouseCaptureLostModelPreview(LLMouseHandler*); static void setUploadAmount(S32 amount) { sUploadAmount = amount; } + static void addStringToLog(const std::string& str, bool flash); + static void addStringToLog(const std::ostringstream& strm, bool flash); void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost); void setPreviewLOD(S32 lod); @@ -176,7 +180,8 @@ protected: // FIXME - this function and mStatusMessage have no visible effect, and the // actual status messages are managed by directly manipulation of // the UI element. - void setStatusMessage(const std::string& msg); + void setStatusMessage(const std::string& msg); + void addStringToLogTab(const std::string& str, bool flash); LLModelPreview* mModelPreview; @@ -221,6 +226,8 @@ private: LLButton* mUploadBtn; LLButton* mCalculateBtn; + LLViewerTextEditor* mUploadLogText; + LLTabContainer* mTabContainer; }; class LLMeshFilePicker : public LLFilePickerThread diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 274e6e6c7a..cbc5aeb37d 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -82,7 +82,8 @@ height="300" width="635" name="import_tab" - tab_position="top"> + tab_position="top" + enable_tabs_flashing="true"> + width="619" /> + + + + + Date: Wed, 27 Nov 2019 20:34:26 +0200 Subject: SL-304 [Mesh Uploader] Localization support for logs, better warnings for joints --- indra/llprimitive/llmodelloader.cpp | 42 +++++++----- indra/llprimitive/llmodelloader.h | 19 ++++-- indra/newview/llfloatermodelpreview.cpp | 76 ++++++++++++++++++---- indra/newview/llfloatermodelpreview.h | 10 +-- .../skins/default/xui/en/floater_model_preview.xml | 31 ++++++++- 5 files changed, 136 insertions(+), 42 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index c8da68afc8..5171621007 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -127,7 +127,7 @@ LLModelLoader::LLModelLoader( , mStateCallback(state_cb) , mOpaqueData(opaque_userdata) , mRigValidJointUpload(true) -, mLegacyRigValid(true) +, mLegacyRigFlags(0) , mNoNormalize(false) , mNoOptimize(false) , mCacheOnlyHitIfRigged(false) @@ -136,6 +136,7 @@ LLModelLoader::LLModelLoader( { assert_main_thread(); sActiveLoaderList.push_back(this) ; + mWarningsArray = LLSD::emptyArray(); } LLModelLoader::~LLModelLoader() @@ -146,7 +147,7 @@ LLModelLoader::~LLModelLoader() void LLModelLoader::run() { - mWarningStream.clear(); + mWarningsArray.clear(); doLoadModel(); doOnIdleOneTime(boost::bind(&LLModelLoader::loadModelCallback,this)); } @@ -388,7 +389,7 @@ void LLModelLoader::critiqueRigForUploadApplicability( const std::vector &jointListFromAsset ) +U32 LLModelLoader::determineRigLegacyFlags( const std::vector &jointListFromAsset ) { //No joints in asset if ( jointListFromAsset.size() == 0 ) @@ -427,8 +425,12 @@ bool LLModelLoader::isRigLegacy( const std::vector &jointListFromAs { LL_WARNS() << "Rigged to " << jointListFromAsset.size() << " joints, max is " << mMaxJointsPerMesh << LL_ENDL; LL_WARNS() << "Skinning disabled due to too many joints" << LL_ENDL; - mWarningStream << "Skinning disabled due to too many joints, maximum amount per mesh: " << mMaxJointsPerMesh << "\n"; - return false; + LLSD args; + args["Message"] = "TooManyJoint"; + args["[JOINTS]"] = LLSD::Integer(jointListFromAsset.size()); + args["[MAX]"] = LLSD::Integer(mMaxJointsPerMesh); + mWarningsArray.append(args); + return LEGACY_RIG_FLAG_TOO_MANY_JOINTS; } // Unknown joints in asset @@ -439,18 +441,24 @@ bool LLModelLoader::isRigLegacy( const std::vector &jointListFromAs if (mJointMap.find(*it)==mJointMap.end()) { LL_WARNS() << "Rigged to unrecognized joint name " << *it << LL_ENDL; - mWarningStream << "Rigged to unrecognized joint name " << *it << "\n"; + LLSD args; + args["Message"] = "UnrecognizedJoint"; + args["[NAME]"] = *it; + mWarningsArray.append(args); unknown_joint_count++; } } if (unknown_joint_count>0) { LL_WARNS() << "Skinning disabled due to unknown joints" << LL_ENDL; - mWarningStream << "Skinning disabled due to unknown joints\n"; - return false; + LLSD args; + args["Message"] = "UnknownJoints"; + args["[COUNT]"] = LLSD::Integer(unknown_joint_count); + mWarningsArray.append(args); + return LEGACY_RIG_FLAG_UNKNOWN_JOINT; } - return true; + return LEGACY_RIG_OK; } //----------------------------------------------------------------------------- // isRigSuitableForJointPositionUpload() diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index 8dde176b54..fbc74554a0 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -42,6 +42,10 @@ typedef std::deque JointNameSet; const S32 SLM_SUPPORTED_VERSION = 3; const S32 NUM_LOD = 4; +const U32 LEGACY_RIG_OK = 0; +const U32 LEGACY_RIG_FLAG_TOO_MANY_JOINTS = 1; +const U32 LEGACY_RIG_FLAG_UNKNOWN_JOINT = 2; + class LLModelLoader : public LLThread { public: @@ -166,7 +170,7 @@ public: void critiqueRigForUploadApplicability( const std::vector &jointListFromAsset ); //Determines if a rig is a legacy from the joint list - bool isRigLegacy( const std::vector &jointListFromAsset ); + U32 determineRigLegacyFlags( const std::vector &jointListFromAsset ); //Determines if a rig is suitable for upload bool isRigSuitableForJointPositionUpload( const std::vector &jointListFromAsset ); @@ -174,8 +178,9 @@ public: const bool isRigValidForJointPositionUpload( void ) const { return mRigValidJointUpload; } void setRigValidForJointPositionUpload( bool rigValid ) { mRigValidJointUpload = rigValid; } - const bool isLegacyRigValid( void ) const { return mLegacyRigValid; } - void setLegacyRigValid( bool rigValid ) { mLegacyRigValid = rigValid; } + const bool isLegacyRigValid(void) const { return mLegacyRigFlags == 0; } + U32 getLegacyRigFlags() const { return mLegacyRigFlags; } + void setLegacyRigFlags( U32 rigFlags ) { mLegacyRigFlags = rigFlags; } //----------------------------------------------------------------------------- // isNodeAJoint() @@ -185,8 +190,8 @@ public: return name != NULL && mJointMap.find(name) != mJointMap.end(); } - std::string logOut() { return mWarningStream.str(); } - void clearLog() { mWarningStream.clear(); } + const LLSD logOut() const { return mWarningsArray; } + void clearLog() { mWarningsArray.clear(); } protected: @@ -197,14 +202,14 @@ protected: void* mOpaqueData; bool mRigValidJointUpload; - bool mLegacyRigValid; + U32 mLegacyRigFlags; bool mNoNormalize; bool mNoOptimize; JointTransformMap mJointTransformMap; - std::ostringstream mWarningStream; // preview floater will pull logs from here + LLSD mWarningsArray; // preview floater will pull logs from here static std::list sActiveLoaderList; static bool isAlive(LLModelLoader* loader) ; diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e1665dc255..b3012ed025 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -343,6 +343,9 @@ BOOL LLFloaterModelPreview::postBuild() childDisable("upload_joints"); childDisable("lock_scale_if_joint_position"); + childSetVisible("skin_too_many_joints", false); + childSetVisible("skin_unknown_joint", false); + initDecompControls(); LLView* preview_panel = getChild("preview_panel"); @@ -1306,6 +1309,34 @@ void LLFloaterModelPreview::onMouseCaptureLostModelPreview(LLMouseHandler* handl //----------------------------------------------------------------------------- // addStringToLog() //----------------------------------------------------------------------------- +//static +void LLFloaterModelPreview::addStringToLog(const std::string& message, const LLSD& args, bool flash, S32 lod) +{ + if (sInstance && sInstance->hasString(message)) + { + std::string str; + switch (lod) + { + case LLModel::LOD_IMPOSTOR: str = "LOD0 "; break; + case LLModel::LOD_LOW: str = "LOD1 "; break; + case LLModel::LOD_MEDIUM: str = "LOD2 "; break; + case LLModel::LOD_PHYSICS: str = "PHYS "; break; + case LLModel::LOD_HIGH: str = "LOD3 "; break; + default: break; + } + + LLStringUtil::format_map_t args_msg; + LLSD::map_const_iterator iter = args.beginMap(); + LLSD::map_const_iterator end = args.endMap(); + for (; iter != end; ++iter) + { + args_msg[iter->first] = iter->second.asString(); + } + str += sInstance->getString(message, args_msg); + sInstance->addStringToLogTab(str, flash); + } +} + // static void LLFloaterModelPreview::addStringToLog(const std::string& str, bool flash) { @@ -1370,7 +1401,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) , mLodsQuery() , mLodsWithParsingError() , mPelvisZOffset( 0.0f ) -, mLegacyRigValid( false ) +, mLegacyRigFlags( U32_MAX ) , mRigValidJointUpload( false ) , mPhysicsSearchLOD( LLModel::LOD_PHYSICS ) , mResetJoints( false ) @@ -2160,7 +2191,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) // Copy determinations about rig so UI will reflect them // setRigValidForJointPositionUpload(mModelLoader->isRigValidForJointPositionUpload()); - setLegacyRigValid(mModelLoader->isLegacyRigValid()); + setLegacyRigFlags(mModelLoader->getLegacyRigFlags()); mModelLoader->loadTextures() ; @@ -3739,9 +3770,18 @@ void LLModelPreview::loadedCallback( LLModelPreview* pPreview = static_cast< LLModelPreview* >(opaque); if (pPreview && !LLModelPreview::sIgnoreLoadedCallback) { - LLFloaterModelPreview::addStringToLog(pPreview->mModelLoader->logOut(), true); - pPreview->mModelLoader->clearLog(); - pPreview->loadModelCallback(lod); // removes mModelLoader in some cases + const LLSD out = pPreview->mModelLoader->logOut(); + LLSD::array_const_iterator iter_out = out.beginArray(); + LLSD::array_const_iterator end_out = out.endArray(); + for (; iter_out != end_out; ++iter_out) + { + if (iter_out->has("Message")) + { + LLFloaterModelPreview::addStringToLog(iter_out->get("Message"), *iter_out, true, pPreview->mModelLoader->mLod); + } + } + pPreview->mModelLoader->clearLog(); + pPreview->loadModelCallback(lod); // removes mModelLoader in some cases } } @@ -3920,13 +3960,25 @@ BOOL LLModelPreview::render() if (has_skin_weights && lodsReady()) { //model has skin weights, enable view options for skin weights and joint positions - if (fmp && isLegacyRigValid() ) - { - fmp->enableViewOption("show_skin_weight"); - fmp->setViewOptionEnabled("show_joint_positions", skin_weight); - mFMP->childEnable("upload_skin"); - mFMP->childSetValue("show_skin_weight", skin_weight); - } + U32 flags = getLegacyRigFlags(); + if (fmp) + { + if (flags == LEGACY_RIG_OK) + { + fmp->enableViewOption("show_skin_weight"); + fmp->setViewOptionEnabled("show_joint_positions", skin_weight); + mFMP->childEnable("upload_skin"); + mFMP->childSetValue("show_skin_weight", skin_weight); + } + else if ((flags & LEGACY_RIG_FLAG_TOO_MANY_JOINTS) > 0) + { + mFMP->childSetVisible("skin_too_many_joints", true); + } + else if ((flags & LEGACY_RIG_FLAG_UNKNOWN_JOINT) > 0) + { + mFMP->childSetVisible("skin_unknown_joint", true); + } + } } else { diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index a080965ffc..5bb6714099 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -94,7 +94,8 @@ public: /*virtual*/ void onClose(bool app_quitting); static void onMouseCaptureLostModelPreview(LLMouseHandler*); - static void setUploadAmount(S32 amount) { sUploadAmount = amount; } + static void setUploadAmount(S32 amount) { sUploadAmount = amount; } + static void addStringToLog(const std::string& message, const LLSD& args, bool flash, S32 lod = -1); static void addStringToLog(const std::string& str, bool flash); static void addStringToLog(const std::ostringstream& strm, bool flash); @@ -308,8 +309,9 @@ public: void setRigValidForJointPositionUpload( bool rigValid ) { mRigValidJointUpload = rigValid; } //Accessors for the legacy rigs - const bool isLegacyRigValid( void ) const { return mLegacyRigValid; } - void setLegacyRigValid( bool rigValid ) { mLegacyRigValid = rigValid; } + const bool isLegacyRigValid( void ) const { return mLegacyRigFlags == 0; } + U32 getLegacyRigFlags() const { return mLegacyRigFlags; } + void setLegacyRigFlags( U32 rigFlags ) { mLegacyRigFlags = rigFlags; } static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); static bool lodQueryCallback(); @@ -423,7 +425,7 @@ private: float mPelvisZOffset; bool mRigValidJointUpload; - bool mLegacyRigValid; + U32 mLegacyRigFlags; bool mLastJointUpdate; diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index cbc5aeb37d..7e92e0360e 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -38,6 +38,12 @@ Analyzing... Simplifying... TBD + + + Skinning disabled due to too many joints: [JOINTS], maximum: [MAX] + Rigged to unrecognized joint name [NAME] + Skinning disabled due to [COUNT] unknown joints + + + Too many skinned joints + + + Model has an unknown joint(s) + + left_delta="-20" + top_pad="1"/> + top_pad="16"/> Date: Thu, 23 Apr 2020 19:34:14 +0300 Subject: SL-13080 Changes for joint listings in mesh uploader --- indra/llprimitive/lldaeloader.cpp | 6 ++ indra/newview/llfloatermodelpreview.cpp | 126 +++++++++++++++++++++++--------- indra/newview/llfloatermodelpreview.h | 5 +- indra/newview/llmodelpreview.cpp | 36 ++++++--- 4 files changed, 126 insertions(+), 47 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 139f48fef8..431443788c 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -1470,6 +1470,12 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do } } + U32 bind_count = model->mSkinInfo.mAlternateBindMatrix.size(); + if (bind_count > 0 && bind_count != jointCnt) + { + LL_WARNS("Mesh") << "Model " << model->mLabel << " has invalid joint bind matrix list." << LL_ENDL; + } + //grab raw position array domVertices* verts = mesh->getVertices(); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 5df3139d0d..666406d039 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -433,46 +433,82 @@ void LLFloaterModelPreview::onClickCalculateBtn() mUploadBtn->setEnabled(false); } -void populate_list_with_map(LLScrollListCtrl *list, const std::map &vector_map) +// Modified cell_params, make sure to clear values if you have to reuse cell_params outside of this function +void add_row_to_list(LLScrollListCtrl *listp, + LLScrollListCell::Params &cell_params, + const LLSD &item_value, + const std::string &name, + const LLSD &vx, + const LLSD &vy, + const LLSD &vz) { - if (vector_map.empty()) + LLScrollListItem::Params item_params; + item_params.value = item_value; + + cell_params.column = "model_name"; + cell_params.value = name; + + item_params.columns.add(cell_params); + + cell_params.column = "axis_x"; + cell_params.value = vx; + item_params.columns.add(cell_params); + + cell_params.column = "axis_y"; + cell_params.value = vy; + item_params.columns.add(cell_params); + + cell_params.column = "axis_z"; + cell_params.value = vz; + + item_params.columns.add(cell_params); + + listp->addRow(item_params); +} + +void populate_list_with_overrides(LLScrollListCtrl *listp, const LLJointOverrideData &data, bool include_overrides) +{ + if (data.mModelsNoOverrides.empty() && data.mPosOverrides.empty()) { return; } + + static const LLSD no_override_placeholder("-"); // LLSD to not conflict in '?' + S32 count = 0; LLScrollListCell::Params cell_params; cell_params.font = LLFontGL::getFontSansSerif(); // Start out right justifying numeric displays cell_params.font_halign = LLFontGL::HCENTER; - std::map::const_iterator iter = vector_map.begin(); - std::map::const_iterator end = vector_map.end(); - while (iter != end) + std::map::const_iterator map_iter = data.mPosOverrides.begin(); + std::map::const_iterator map_end = data.mPosOverrides.end(); + while (map_iter != map_end) { - LLScrollListItem::Params item_params; - item_params.value = LLSD::Integer(count); - - cell_params.column = "model_name"; - cell_params.value = iter->first; - - item_params.columns.add(cell_params); - - cell_params.column = "axis_x"; - cell_params.value = iter->second.mV[VX]; - item_params.columns.add(cell_params); - - cell_params.column = "axis_y"; - cell_params.value = iter->second.mV[VY]; - item_params.columns.add(cell_params); - - cell_params.column = "axis_z"; - cell_params.value = iter->second.mV[VZ]; - - item_params.columns.add(cell_params); + add_row_to_list(listp, + cell_params, + LLSD::Integer(count), + map_iter->first, + include_overrides ? map_iter->second.mV[VX] : no_override_placeholder, + include_overrides ? map_iter->second.mV[VY] : no_override_placeholder, + include_overrides ? map_iter->second.mV[VZ] : no_override_placeholder); + count++; + map_iter++; + } - list->addRow(item_params); + std::set::const_iterator set_iter = data.mModelsNoOverrides.begin(); + std::set::const_iterator set_end = data.mModelsNoOverrides.end(); + while (set_iter != set_end) + { + add_row_to_list(listp, + cell_params, + LLSD::Integer(count), + *set_iter, + no_override_placeholder, + no_override_placeholder, + no_override_placeholder); count++; - iter++; + set_iter++; } } @@ -493,7 +529,8 @@ void LLFloaterModelPreview::onJointListSelection() { std::string label = selected->getValue().asString(); LLJointOverrideData &data = mJointOverrides[display_lod][label]; - populate_list_with_map(joints_pos, data.mPosOverrides); + bool upload_joint_positions = childGetValue("upload_joints").asBoolean(); + populate_list_with_overrides(joints_pos, data, upload_joint_positions); joint_pos_descr->setTextArg("[JOINT]", label); mSelectedJointName = label; @@ -1285,7 +1322,7 @@ void LLFloaterModelPreview::clearAvatarTab() joint_pos_descr->setTextArg("[JOINT]", std::string("mPelvis")); // Might be better to hide it } -void LLFloaterModelPreview::updateAvatarTab() +void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides) { S32 display_lod = mModelPreview->mPreviewLOD; if (mModelPreview->mModel[display_lod].empty()) @@ -1307,10 +1344,22 @@ void LLFloaterModelPreview::updateAvatarTab() LLModelInstance& instance = *model_iter; LLModel* model = instance.mModel; const LLMeshSkinInfo *skin = &model->mSkinInfo; - if (skin->mAlternateBindMatrix.size() > 0) + U32 joint_count = LLSkinningUtil::getMeshJointCount(skin); + U32 bind_count = highlight_overrides ? skin->mAlternateBindMatrix.size() : 0; // simply do not include overrides if data is not needed + if (bind_count > 0 && bind_count != joint_count) + { + std::ostringstream out; + out << "Invalid joint overrides for model " << model->getName(); + out << ". Amount of joints " << joint_count; + out << ", is different from amount of overrides " << bind_count; + LL_INFOS() << out.str() << LL_ENDL; + addStringToLog(out.str(), true); + // Disable overrides for this model + bind_count = 0; + } + if (bind_count > 0) { - U32 count = LLSkinningUtil::getMeshJointCount(skin); - for (U32 j = 0; j < count; ++j) + for (U32 j = 0; j < joint_count; ++j) { const LLVector3& jointPos = skin->mAlternateBindMatrix[j].getTranslation(); LLJointOverrideData &data = mJointOverrides[display_lod][skin->mJointNames[j]]; @@ -1323,7 +1372,14 @@ void LLFloaterModelPreview::updateAvatarTab() data.mHasConflicts = true; } data.mPosOverrides[model->getName()] = jointPos; - + } + } + else + { + for (U32 j = 0; j < joint_count; ++j) + { + LLJointOverrideData &data = mJointOverrides[display_lod][skin->mJointNames[j]]; + data.mModelsNoOverrides.insert(model->getName()); } } } @@ -1364,6 +1420,10 @@ void LLFloaterModelPreview::updateAvatarTab() cell_params.color = LLColor4::orange; conflicts++; } + if (highlight_overrides && joint_iter->second.mPosOverrides.size() > 0) + { + cell_params.font.style = "BOLD"; + } item_params.columns.add(cell_params); diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index ca52312756..48b90e9d44 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -43,7 +43,8 @@ class LLJointOverrideData { public: LLJointOverrideData() : mHasConflicts(false) {}; - std::map mPosOverrides; + std::map mPosOverrides; // models with overrides + std::set mModelsNoOverrides; // models without defined overrides bool mHasConflicts; }; typedef std::map joint_override_data_map_t; @@ -86,7 +87,7 @@ public: static void addStringToLog(const std::string& str, bool flash); static void addStringToLog(const std::ostringstream& strm, bool flash); void clearAvatarTab(); // clears table - void updateAvatarTab(); // populates table and data as nessesary + void updateAvatarTab(bool highlight_overrides); // populates table and data as nessesary void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost); void setPreviewLOD(S32 lod); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 9e39d0cf51..21c6895a6c 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -2734,6 +2734,10 @@ BOOL LLModelPreview::render() if (upload_joints != mLastJointUpdate) { mLastJointUpdate = upload_joints; + if (fmp) + { + fmp->clearAvatarTab(); + } } for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter) @@ -2801,22 +2805,27 @@ BOOL LLModelPreview::render() upload_joints = false; } - if (upload_skin && upload_joints) + if (fmp) { - mFMP->childEnable("lock_scale_if_joint_position"); - if (fmp) + if (upload_skin) { - fmp->updateAvatarTab(); + // will populate list of joints + fmp->updateAvatarTab(upload_joints); } + else + { + fmp->clearAvatarTab(); + } + } + + if (upload_skin && upload_joints) + { + mFMP->childEnable("lock_scale_if_joint_position"); } else { mFMP->childDisable("lock_scale_if_joint_position"); mFMP->childSetValue("lock_scale_if_joint_position", false); - if (fmp) - { - fmp->clearAvatarTab(); - } } //Only enable joint offsets if it passed the earlier critiquing @@ -3218,9 +3227,12 @@ BOOL LLModelPreview::render() { const LLMeshSkinInfo *skin = &model->mSkinInfo; LLSkinningUtil::initJointNums(&model->mSkinInfo, getPreviewAvatar());// inits skin->mJointNums if nessesary - U32 count = LLSkinningUtil::getMeshJointCount(skin); + U32 joint_count = LLSkinningUtil::getMeshJointCount(skin); + U32 bind_count = skin->mAlternateBindMatrix.size(); - if (joint_overrides && skin->mAlternateBindMatrix.size() > 0) + if (joint_overrides + && bind_count > 0 + && joint_count == bind_count) { // mesh_id is used to determine which mesh gets to // set the joint offset, in the event of a conflict. Since @@ -3231,7 +3243,7 @@ BOOL LLModelPreview::render() // incorrect. LLUUID fake_mesh_id; fake_mesh_id.generate(); - for (U32 j = 0; j < count; ++j) + for (U32 j = 0; j < joint_count; ++j) { LLJoint *joint = getPreviewAvatar()->getJoint(skin->mJointNums[j]); if (joint) @@ -3278,7 +3290,7 @@ BOOL LLModelPreview::render() //build matrix palette LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT]; - LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, count, + LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, joint_count, skin, getPreviewAvatar()); LLMatrix4a bind_shape_matrix; -- cgit v1.3 From 7a9a114e168ea68345b54e80b3cfbac7deb4764a Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 3 Aug 2020 19:14:09 +0300 Subject: SL-13698 FIXED crash on model upload --- indra/llprimitive/lldaeloader.cpp | 26 +++++++++++++++++----- indra/llprimitive/lldaeloader.h | 2 +- .../skins/default/xui/en/floater_model_preview.xml | 1 + 3 files changed, 22 insertions(+), 7 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 431443788c..b9c74b7039 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -343,7 +343,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa return LLModel::NO_ERRORS ; } -LLModel::EModelStatus load_face_from_dom_polylist(std::vector& face_list, std::vector& materials, domPolylistRef& poly) +LLModel::EModelStatus load_face_from_dom_polylist(std::vector& face_list, std::vector& materials, domPolylistRef& poly, LLSD& log_msg) { domPRef p = poly->getP(); domListOfUInts& idx = p->getValue(); @@ -403,6 +403,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac LLVolumeFace::VertexMapData::PointMap point_map; U32 cur_idx = 0; + bool log_tc_msg = true; for (U32 i = 0; i < vcount.getCount(); ++i) { //for each polygon U32 first_index = 0; @@ -426,8 +427,21 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (tc_source) { - cv.mTexCoord.setVec(tc[idx[cur_idx+tc_offset]*2+0], - tc[idx[cur_idx+tc_offset]*2+1]); + U64 idx_x = idx[cur_idx + tc_offset] * 2 + 0; + U64 idx_y = idx[cur_idx + tc_offset] * 2 + 1; + + if (idx_y < tc.getCount()) + { + cv.mTexCoord.setVec(tc[idx_x], tc[idx_y]); + } + else if (log_tc_msg) + { + log_tc_msg = false; + LL_WARNS() << "Texture coordinates data is not complete." << LL_ENDL; + LLSD args; + args["Message"] = "IncompleteTC"; + log_msg.append(args); + } } if (norm_source) @@ -2362,7 +2376,7 @@ LLColor4 LLDAELoader::getDaeColor(daeElement* element) return value; } -bool LLDAELoader::addVolumeFacesFromDomMesh(LLModel* pModel,domMesh* mesh) +bool LLDAELoader::addVolumeFacesFromDomMesh(LLModel* pModel,domMesh* mesh, LLSD& log_msg) { LLModel::EModelStatus status = LLModel::NO_ERRORS; domTriangles_Array& tris = mesh->getTriangles_array(); @@ -2384,7 +2398,7 @@ bool LLDAELoader::addVolumeFacesFromDomMesh(LLModel* pModel,domMesh* mesh) for (U32 i = 0; i < polys.getCount(); ++i) { domPolylistRef& poly = polys.get(i); - status = load_face_from_dom_polylist(pModel->getVolumeFaces(), pModel->getMaterialList(), poly); + status = load_face_from_dom_polylist(pModel->getVolumeFaces(), pModel->getMaterialList(), poly, log_msg); if(status != LLModel::NO_ERRORS) { @@ -2448,7 +2462,7 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector& mo // Get the whole set of volume faces // - addVolumeFacesFromDomMesh(ret, mesh); + addVolumeFacesFromDomMesh(ret, mesh, mWarningsArray); U32 volume_faces = ret->getNumVolumeFaces(); diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index 4e990dbe5e..b2db538d32 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -89,7 +89,7 @@ protected: //Verify that a controller matches vertex counts bool verifyController( domController* pController ); - static bool addVolumeFacesFromDomMesh(LLModel* model, domMesh* mesh); + static bool addVolumeFacesFromDomMesh(LLModel* model, domMesh* mesh, LLSD& log_msg = LLSD()); static bool createVolumeFacesFromDomMesh(LLModel* model, domMesh *mesh); static LLModel* loadModelFromDomMesh(domMesh* mesh); diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 4fa0b9af7d..9c1a9d2880 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -45,6 +45,7 @@ Rigged to unrecognized joint name [NAME] Skinning disabled due to [COUNT] unknown joints Model [MODEL_NAME] loaded + Texture coordinates data is not complete. Date: Tue, 11 Aug 2020 20:43:31 +0300 Subject: SL-13698 Mac build fix --- indra/llprimitive/lldaeloader.cpp | 3 ++- indra/llprimitive/lldaeloader.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index b9c74b7039..3cb58d894e 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -2535,7 +2535,8 @@ bool LLDAELoader::createVolumeFacesFromDomMesh(LLModel* pModel, domMesh* mesh) { pModel->ClearFacesAndMaterials(); - addVolumeFacesFromDomMesh(pModel, mesh); + LLSD placeholder; + addVolumeFacesFromDomMesh(pModel, mesh, placeholder); if (pModel->getNumVolumeFaces() > 0) { diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index b2db538d32..2b211343e1 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -89,7 +89,7 @@ protected: //Verify that a controller matches vertex counts bool verifyController( domController* pController ); - static bool addVolumeFacesFromDomMesh(LLModel* model, domMesh* mesh, LLSD& log_msg = LLSD()); + static bool addVolumeFacesFromDomMesh(LLModel* model, domMesh* mesh, LLSD& log_msg); static bool createVolumeFacesFromDomMesh(LLModel* model, domMesh *mesh); static LLModel* loadModelFromDomMesh(domMesh* mesh); -- cgit v1.3 From bdedfb3755d54a6b4468a5251c9ddeae2b092d37 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 28 Aug 2020 21:00:04 +0300 Subject: SL-13566 'Use Joint Positions' Option causes collapsed Joints for some files --- indra/llprimitive/lldaeloader.cpp | 104 +++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 51 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 3cb58d894e..d2aa3d8dc6 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -1229,7 +1229,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do for (S32 i = 0; i < childCount; ++i) { domNode* pNode = daeSafeCast(children[i]); - if ( isNodeAJoint( pNode ) ) + if (pNode) { processJointNode( pNode, mJointList ); } @@ -1854,59 +1854,61 @@ void LLDAELoader::processJointNode( domNode* pNode, JointTransformMap& jointTran //LL_WARNS()<<"ProcessJointNode# Node:" <getName()<( jointResolverA.getElement() ); - daeSIDResolver jointResolverB( pNode, "./location" ); - domTranslate* pTranslateB = daeSafeCast( jointResolverB.getElement() ); + //Pull out the translate id and store it in the jointTranslations map + daeSIDResolver jointResolverA(pNode, "./translate"); + domTranslate* pTranslateA = daeSafeCast(jointResolverA.getElement()); + daeSIDResolver jointResolverB(pNode, "./location"); + domTranslate* pTranslateB = daeSafeCast(jointResolverB.getElement()); - //Translation via SID was successful - if ( pTranslateA ) - { - extractTranslation( pTranslateA, workingTransform ); - } - else - if ( pTranslateB ) - { - extractTranslation( pTranslateB, workingTransform ); - } - else - { - //Translation via child from element - daeElement* pTranslateElement = getChildFromElement( pNode, "translate" ); - if ( !pTranslateElement || pTranslateElement->typeID() != domTranslate::ID() ) - { - //LL_WARNS()<< "The found element is not a translate node" <( jointResolver.getElement() ); - if ( pMatrix ) - { - //LL_INFOS()<<"A matrix SID was however found!"<getValue(); - for ( int i = 0; i < 4; i++ ) - { - for( int j = 0; j < 4; j++ ) - { - workingTransform.mMatrix[i][j] = domArray[i + j*4]; - } - } - } - else - { - LL_WARNS()<< "The found element is not translate or matrix node - most likely a corrupt export!" <typeID() != domTranslate::ID()) + { + //LL_WARNS()<< "The found element is not a translate node" <(jointResolver.getElement()); + if (pMatrix) + { + //LL_INFOS()<<"A matrix SID was however found!"<getValue(); + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 4; j++) + { + workingTransform.mMatrix[i][j] = domArray[i + j * 4]; + } + } + } + else + { + LL_WARNS() << "The found element is not translate or matrix node - most likely a corrupt export!" << LL_ENDL; + } + } + else + { + extractTranslationViaElement(pTranslateElement, workingTransform); + } + } - //Store the working transform relative to the nodes name. - jointTransforms[ pNode->getName() ] = workingTransform; + //Store the working transform relative to the nodes name. + jointTransforms[pNode->getName()] = workingTransform; + } //2. handle the nodes children -- cgit v1.3