From cac08f80a44139f9752523dca278eefde96a6a8c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 23 Apr 2020 20:04:01 +0300 Subject: [PATCH 1/9] SL-13074 FIXED [Mesh Uploader] "The texture is empty" error is displayed after trying to upload the model with the texture from the non-English directory --- indra/newview/llmodelpreview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 9260699985..9e39d0cf51 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -2619,7 +2619,7 @@ U32 LLModelPreview::loadTextures(LLImportMaterial& material, void* opaque) material.mOpaqueData = new LLPointer< LLViewerFetchedTexture >; LLPointer< LLViewerFetchedTexture >& tex = (*reinterpret_cast< LLPointer< LLViewerFetchedTexture > * >(material.mOpaqueData)); - tex = LLViewerTextureManager::getFetchedTextureFromUrl("file://" + material.mDiffuseMapFilename, FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_PREVIEW); + tex = LLViewerTextureManager::getFetchedTextureFromUrl("file://" + LLURI::unescape(material.mDiffuseMapFilename), FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_PREVIEW); tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, opaque, NULL, FALSE); tex->forceToSaveRawImage(0, F32_MAX); material.setDiffuseMap(tex->getID()); // record tex ID From c54e0e4f12dedff2d64354215fd7bcb68b09c7fd Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 23 Apr 2020 19:33:47 +0300 Subject: [PATCH 2/9] SL-12678 Remove automatic retry of login --- indra/newview/lllogininstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 8a69acb8dc..873531ef22 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -62,7 +62,7 @@ #include #include -const S32 LOGIN_MAX_RETRIES = 3; +const S32 LOGIN_MAX_RETRIES = 0; // Viewer should not autmatically retry login const F32 LOGIN_SRV_TIMEOUT_MIN = 10; const F32 LOGIN_SRV_TIMEOUT_MAX = 120; const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9; // make DNS wait shorter then retry time From 9221c8a3f65aa14cad4fec03b7033ad800f6ba35 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 23 Apr 2020 19:34:14 +0300 Subject: [PATCH 3/9] SL-13080 Changes for joint listings in mesh uploader --- indra/llprimitive/lldaeloader.cpp | 6 ++ indra/newview/llfloatermodelpreview.cpp | 128 +++++++++++++++++------- indra/newview/llfloatermodelpreview.h | 5 +- indra/newview/llmodelpreview.cpp | 36 ++++--- 4 files changed, 127 insertions(+), 48 deletions(-) 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); - - list->addRow(item_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++; - iter++; + map_iter++; + } + + 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++; + 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) { - U32 count = LLSkinningUtil::getMeshJointCount(skin); - for (U32 j = 0; j < count; ++j) + 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) + { + 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 (fmp) + { + if (upload_skin) + { + // will populate list of joints + fmp->updateAvatarTab(upload_joints); + } + else + { + fmp->clearAvatarTab(); + } + } + if (upload_skin && upload_joints) { mFMP->childEnable("lock_scale_if_joint_position"); - if (fmp) - { - fmp->updateAvatarTab(); - } } 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; From c0ed9d28f19bcdde171842370e87eb82cf43b896 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 24 Apr 2020 02:37:35 +0300 Subject: [PATCH 4/9] SL-13080 Filter out default overrides --- indra/newview/llfloatermodelpreview.cpp | 31 ++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 666406d039..083c2dab37 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1361,17 +1361,32 @@ void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides) { for (U32 j = 0; j < joint_count; ++j) { - const LLVector3& jointPos = skin->mAlternateBindMatrix[j].getTranslation(); + const LLVector3& joint_pos = skin->mAlternateBindMatrix[j].getTranslation(); LLJointOverrideData &data = mJointOverrides[display_lod][skin->mJointNames[j]]; - if (data.mPosOverrides.size() > 0 - && (data.mPosOverrides.begin()->second - jointPos).lengthSquared() > (LL_JOINT_TRESHOLD_POS_OFFSET * LL_JOINT_TRESHOLD_POS_OFFSET)) + + LLJoint* pJoint = LLModelPreview::lookupJointByName(skin->mJointNames[j], mModelPreview); + if (pJoint) { - // File contains multiple meshes with conflicting joint offsets - // preview may be incorrect, upload result might wary (depends onto - // mesh_id that hasn't been generated yet). - data.mHasConflicts = true; + // see how voavatar uses aboveJointPosThreshold + if (pJoint->aboveJointPosThreshold(joint_pos)) + { + // valid override + if (data.mPosOverrides.size() > 0 + && (data.mPosOverrides.begin()->second - joint_pos).lengthSquared() > (LL_JOINT_TRESHOLD_POS_OFFSET * LL_JOINT_TRESHOLD_POS_OFFSET)) + { + // File contains multiple meshes with conflicting joint offsets + // preview may be incorrect, upload result might wary (depends onto + // mesh_id that hasn't been generated yet). + data.mHasConflicts = true; + } + data.mPosOverrides[model->getName()] = joint_pos; + } + else + { + // default value, it won't be accounted for by avatar + data.mModelsNoOverrides.insert(model->getName()); + } } - data.mPosOverrides[model->getName()] = jointPos; } } else From 0bc76461fa4445491cf119e80cb854f1d6dd6896 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 24 Apr 2020 02:47:18 +0300 Subject: [PATCH 5/9] SL-13080 Mac build fix --- indra/newview/llfloatermodelpreview.cpp | 29 ++++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 083c2dab37..ba67f297a0 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -473,7 +473,7 @@ void populate_list_with_overrides(LLScrollListCtrl *listp, const LLJointOverride return; } - static const LLSD no_override_placeholder("-"); // LLSD to not conflict in '?' + static const std::string no_override_placeholder = "-"; S32 count = 0; LLScrollListCell::Params cell_params; @@ -485,13 +485,26 @@ void populate_list_with_overrides(LLScrollListCtrl *listp, const LLJointOverride std::map::const_iterator map_end = data.mPosOverrides.end(); while (map_iter != map_end) { - 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); + if (include_overrides) + { + add_row_to_list(listp, + cell_params, + LLSD::Integer(count), + map_iter->first, + LLSD::Real(map_iter->second.mV[VX]), + LLSD::Real(map_iter->second.mV[VY]), + LLSD::Real(map_iter->second.mV[VZ])); + } + else + { + add_row_to_list(listp, + cell_params, + LLSD::Integer(count), + map_iter->first, + no_override_placeholder, + no_override_placeholder, + no_override_placeholder); + } count++; map_iter++; } From a0e91e9e505e747f876712fe8ec5c250b56e1dcf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 24 Apr 2020 18:05:14 +0300 Subject: [PATCH 6/9] SL-307 Improvements to flashing color --- indra/llui/llbutton.cpp | 22 ++++++++++-------- indra/llui/lltabcontainer.cpp | 18 +++++++------- indra/llui/lltabcontainer.h | 3 ++- indra/newview/llfloatermodelpreview.cpp | 5 +--- .../containers/TabTop_Right_Flashing.png | Bin 0 -> 252 bytes .../skins/default/textures/textures.xml | 1 + .../default/xui/en/floater_model_preview.xml | 5 +++- 7 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 indra/newview/skins/default/textures/containers/TabTop_Right_Flashing.png diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 804204cce0..9682c3bc10 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -643,7 +643,8 @@ void LLButton::draw() LLColor4 highlighting_color = LLColor4::white; LLColor4 glow_color = LLColor4::white; LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA; - LLUIImage* imagep = NULL; + LLUIImage* imagep = NULL; + LLUIImage* image_glow = NULL; // Cancel sticking of color, if the button is pressed, // or when a flashing of the previously selected button is ended @@ -710,17 +711,18 @@ void LLButton::draw() imagep = mImageDisabled; } + image_glow = imagep; + if (mFlashing) { - // if button should flash and we have icon for flashing, use it as image for button - if(flash && mImageFlash) + if (flash && mImageFlash) { - // setting flash to false to avoid its further influence on glow - flash = false; - imagep = mImageFlash; + // if button should flash and we have icon for flashing, use it as image for button + image_glow = mImageFlash; } - // else use usual flashing via flash_color - else if (mFlashingTimer) + + // provide fade-in and fade-out via flash_color + if (mFlashingTimer) { LLColor4 flash_color = mFlashBgColor.get(); use_glow_effect = TRUE; @@ -811,7 +813,7 @@ void LLButton::draw() if (mCurGlowStrength > 0.01f) { gGL.setSceneBlendType(glow_type); - imagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), glow_color % (mCurGlowStrength * alpha)); + image_glow->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), glow_color % (mCurGlowStrength * alpha)); gGL.setSceneBlendType(LLRender::BT_ALPHA); } } @@ -822,7 +824,7 @@ void LLButton::draw() if (mCurGlowStrength > 0.01f) { gGL.setSceneBlendType(glow_type); - imagep->drawSolid(0, y, glow_color % (mCurGlowStrength * alpha)); + image_glow->drawSolid(0, y, glow_color % (mCurGlowStrength * alpha)); gGL.setSceneBlendType(LLRender::BT_ALPHA); } } diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 750a3aff9c..e6b43da8e5 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -221,6 +221,7 @@ LLTabContainer::Params::Params() 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), + tabs_flashing_color("tabs_flashing_color"), tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0), use_ellipses("use_ellipses"), font_halign("halign") @@ -261,6 +262,7 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mOpenTabsOnDragAndDrop(p.open_tabs_on_drag_and_drop), mTabIconCtrlPad(p.tab_icon_ctrl_pad), mEnableTabsFlashing(p.enable_tabs_flashing), + mTabsFlashingColor(p.tabs_flashing_color), mUseTabEllipses(p.use_ellipses) { static LLUICachedControl tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0); @@ -282,6 +284,11 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mMinTabWidth = tabcntr_vert_tab_min_width; } + if (p.tabs_flashing_color.isProvided()) + { + mEnableTabsFlashing = true; + } + initButtons( ); } @@ -1107,6 +1114,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) // inits flash timer p.button_flash_enable = mEnableTabsFlashing; + p.flash_color = mTabsFlashingColor; // *TODO : It seems wrong not to use p in both cases considering the way p is initialized if (mCustomIconCtrlUsed) @@ -1642,16 +1650,6 @@ void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state ) } } -void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state, LLUIColor color) -{ - LLTabTuple* tuple = getTabByPanel(child); - if (tuple) - { - tuple->mButton->setFlashColor(color); - tuple->mButton->setFlashing(state); - } -} - void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const LLColor4& color) { LLTabTuple* tuple = getTabByPanel(child); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 5339bec3dd..8f8cedb1b9 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -114,6 +114,7 @@ public: * Enable tab flashing */ Optional enable_tabs_flashing; + Optional tabs_flashing_color; /** * Paddings for LLIconCtrl in case of LLCustomButtonIconCtrl usage(use_custom_icon_ctrl = true) @@ -203,7 +204,6 @@ public: BOOL getTabPanelFlashing(LLPanel* child); void setTabPanelFlashing(LLPanel* child, BOOL state); - void setTabPanelFlashing(LLPanel* child, BOOL state, LLUIColor color); void setTabImage(LLPanel* child, std::string img_name, const LLColor4& color = LLColor4::white); void setTabImage(LLPanel* child, const LLUUID& img_id, const LLColor4& color = LLColor4::white); void setTabImage(LLPanel* child, LLIconCtrl* icon); @@ -317,6 +317,7 @@ private: bool mCustomIconCtrlUsed; bool mOpenTabsOnDragAndDrop; bool mEnableTabsFlashing; + LLUIColor mTabsFlashingColor; S32 mTabIconCtrlPad; bool mUseTabEllipses; }; diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index ba67f297a0..1d3fb5bcfc 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1519,10 +1519,7 @@ void LLFloaterModelPreview::addStringToLogTab(const std::string& str, bool flash LLPanel* panel = mTabContainer->getPanelByName("logs_panel"); if (mTabContainer->getCurrentPanel() != panel) { - // This will makes colors pale due to "glow_type = LLRender::BT_ALPHA" - // So instead of using "MenuItemFlashBgColor" added stronger color - static LLUIColor sFlashBgColor(LLColor4U(255, 99, 0)); - mTabContainer->setTabPanelFlashing(panel, true, sFlashBgColor); + mTabContainer->setTabPanelFlashing(panel, true); } } } diff --git a/indra/newview/skins/default/textures/containers/TabTop_Right_Flashing.png b/indra/newview/skins/default/textures/containers/TabTop_Right_Flashing.png new file mode 100644 index 0000000000000000000000000000000000000000..fd13bb699d5fe01cf9c0ebb42ff96d102042a66c GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^Za^&0!3HFw*6-d8q!^2X+?^QKos)S9a~60+7BevL9RguSQ4OyKpx{JL7srqc=eL)3^ENvOFkF19lH_rhSJQS! z#PtUqd>uMLiw<`eRs=JCUUIee(8V&rk7su7wtYT%^OH5t-NUnO&vn-=3pzFJ`R + 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 e8c64dfef7..66878f227b 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -90,7 +90,10 @@ width="635" name="import_tab" tab_position="top" - enable_tabs_flashing="true"> + enable_tabs_flashing="true" + tabs_flashing_color="MenuItemFlashBgColor"> + Date: Fri, 24 Apr 2020 18:29:18 +0300 Subject: [PATCH 7/9] SL-307 Improvements to logging --- indra/newview/llfloatermodelpreview.cpp | 2 +- indra/newview/llmodelpreview.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 1d3fb5bcfc..98ffd30bc7 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -413,7 +413,7 @@ void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name, boo void LLFloaterModelPreview::onClickCalculateBtn() { clearLogTab(); - + addStringToLog("Calculating model data.", false); mModelPreview->rebuildUploadData(); bool upload_skinweights = childGetValue("upload_skin").asBoolean(); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 21c6895a6c..6de88b318a 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -562,6 +562,7 @@ void LLModelPreview::rebuildUploadData() LLModel* high_lod_model = instance.mLOD[LLModel::LOD_HIGH]; if (!high_lod_model) { + LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has no High Lod (LOD3).", true); setLoadState(LLModelLoader::ERROR_MATERIALS); mFMP->childDisable("calculate_btn"); } @@ -574,6 +575,7 @@ void LLModelPreview::rebuildUploadData() llassert(instance.mLOD[i]); if (instance.mLOD[i] && !instance.mLOD[i]->matchMaterialOrder(high_lod_model, refFaceCnt, modelFaceCnt)) { + LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has mismatching materials between lods." , true); setLoadState(LLModelLoader::ERROR_MATERIALS); mFMP->childDisable("calculate_btn"); } @@ -593,7 +595,7 @@ void LLModelPreview::rebuildUploadData() out << bind_rot; LL_WARNS() << out.str() << LL_ENDL; - LLFloaterModelPreview::addStringToLog(out, false); + LLFloaterModelPreview::addStringToLog(out, getLoadState() != LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION); setLoadState(LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION); } } @@ -626,7 +628,7 @@ void LLModelPreview::rebuildUploadData() std::ostringstream out; out << "Model " << mModel[lod][model_ind]->mLabel << " was not used - mismatching lod models."; LL_INFOS() << out.str() << LL_ENDL; - LLFloaterModelPreview::addStringToLog(out, false); + LLFloaterModelPreview::addStringToLog(out, true); } setLoadState(LLModelLoader::ERROR_MATERIALS); mFMP->childDisable("calculate_btn"); From aa014a65e76a1312dee82de38dc8d73b64e7a8b5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 24 Apr 2020 20:50:57 +0300 Subject: [PATCH 8/9] SL-13123 Bind shape matrix orientation warning is misbehaving --- indra/newview/llfloatermodelpreview.cpp | 21 +++++---------------- indra/newview/llfloatermodelpreview.h | 1 - indra/newview/llmodelpreview.cpp | 4 ++++ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 98ffd30bc7..f609e8a91a 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -180,7 +180,6 @@ BOOL LLFloaterModelPreview::postBuild() childSetCommitCallback("preview_lod_combo", onPreviewLODCommit, this); - childSetCommitCallback("upload_skin", onUploadSkinCommit, this); childSetCommitCallback("upload_joints", onUploadJointsCommit, this); childSetCommitCallback("lock_scale_if_joint_position", onUploadJointsCommit, this); @@ -331,7 +330,11 @@ void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl) if (mModelPreview) { auto name = ctrl->getName(); - mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name]; + mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name]; + mModelPreview->refresh(); + mModelPreview->resetPreviewTarget(); + mModelPreview->clearBuffers(); + mModelPreview->mDirty = true; } toggleCalculateButton(true); } @@ -615,20 +618,6 @@ void LLFloaterModelPreview::onUploadJointsCommit(LLUICtrl*,void* userdata) fp->mModelPreview->refresh(); } -//static -void LLFloaterModelPreview::onUploadSkinCommit(LLUICtrl*,void* userdata) -{ - LLFloaterModelPreview *fp =(LLFloaterModelPreview *)userdata; - - if (!fp->mModelPreview) - { - return; - } - fp->mModelPreview->refresh(); - fp->mModelPreview->resetPreviewTarget(); - fp->mModelPreview->clearBuffers(); -} - //static void LLFloaterModelPreview::onPreviewLODCommit(LLUICtrl* ctrl, void* userdata) { diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 48b90e9d44..6ecc279365 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -140,7 +140,6 @@ protected: static void onImportScaleCommit(LLUICtrl*, void*); static void onPelvisOffsetCommit(LLUICtrl*, void*); static void onUploadJointsCommit(LLUICtrl*,void*); - static void onUploadSkinCommit(LLUICtrl*,void*); static void onPreviewLODCommit(LLUICtrl*,void*); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 6de88b318a..dbb2c162a3 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -599,6 +599,10 @@ void LLModelPreview::rebuildUploadData() setLoadState(LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION); } } + else if (getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) + { + setLoadState(LLModelLoader::DONE); + } } instance.mTransform = mat; mUploadData.push_back(instance); From 4ac08f1ac5b003b95fc9087183d03c0291f6554b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 25 Apr 2020 14:35:44 +0300 Subject: [PATCH 9/9] SL-13123 Cleanup --- indra/newview/llfloatermodelpreview.cpp | 26 ++++++--------------- indra/newview/llfloatermodelpreview.h | 1 - indra/newview/llmodelpreview.cpp | 30 ++++++++++++++++++------- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index f609e8a91a..a52cf981c7 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -166,6 +166,7 @@ BOOL LLFloaterModelPreview::postBuild() getChild("lod_triangle_limit_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, true)); } + // Upload/avatar options, they need to refresh errors/notifications childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); childSetCommitCallback("lock_scale_if_joint_position", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); @@ -180,9 +181,6 @@ BOOL LLFloaterModelPreview::postBuild() childSetCommitCallback("preview_lod_combo", onPreviewLODCommit, this); - childSetCommitCallback("upload_joints", onUploadJointsCommit, this); - childSetCommitCallback("lock_scale_if_joint_position", onUploadJointsCommit, this); - childSetCommitCallback("import_scale", onImportScaleCommit, this); childSetCommitCallback("pelvis_offset", onPelvisOffsetCommit, this); @@ -330,12 +328,15 @@ void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl) if (mModelPreview) { auto name = ctrl->getName(); + // update the option and notifications + // (this is a bit convoluted, because of the current structure of mModelPreview) mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name]; - mModelPreview->refresh(); - mModelPreview->resetPreviewTarget(); + mModelPreview->refresh(); // a 'dirty' flag for render + mModelPreview->resetPreviewTarget(); mModelPreview->clearBuffers(); mModelPreview->mDirty = true; - } + } + // set the button visible, it will be refreshed later toggleCalculateButton(true); } @@ -605,19 +606,6 @@ void LLFloaterModelPreview::onPelvisOffsetCommit( LLUICtrl*, void* userdata ) fp->mModelPreview->refresh(); } -//static -void LLFloaterModelPreview::onUploadJointsCommit(LLUICtrl*,void* userdata) -{ - LLFloaterModelPreview *fp =(LLFloaterModelPreview *)userdata; - - if (!fp->mModelPreview) - { - return; - } - - fp->mModelPreview->refresh(); -} - //static void LLFloaterModelPreview::onPreviewLODCommit(LLUICtrl* ctrl, void* userdata) { diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 6ecc279365..7b344ef2b2 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -139,7 +139,6 @@ protected: static void onImportScaleCommit(LLUICtrl*, void*); static void onPelvisOffsetCommit(LLUICtrl*, void*); - static void onUploadJointsCommit(LLUICtrl*,void*); static void onPreviewLODCommit(LLUICtrl*,void*); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index dbb2c162a3..9530e02c06 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -361,6 +361,7 @@ void LLModelPreview::rebuildUploadData() F32 max_scale = 0.f; BOOL legacyMatching = gSavedSettings.getBOOL("ImporterLegacyMatching"); + U32 load_state = 0; for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter) { //for each transform in scene @@ -563,7 +564,7 @@ void LLModelPreview::rebuildUploadData() if (!high_lod_model) { LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has no High Lod (LOD3).", true); - setLoadState(LLModelLoader::ERROR_MATERIALS); + load_state = LLModelLoader::ERROR_MATERIALS; mFMP->childDisable("calculate_btn"); } else @@ -576,7 +577,7 @@ void LLModelPreview::rebuildUploadData() if (instance.mLOD[i] && !instance.mLOD[i]->matchMaterialOrder(high_lod_model, refFaceCnt, modelFaceCnt)) { LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has mismatching materials between lods." , true); - setLoadState(LLModelLoader::ERROR_MATERIALS); + load_state = LLModelLoader::ERROR_MATERIALS; mFMP->childDisable("calculate_btn"); } } @@ -588,6 +589,8 @@ void LLModelPreview::rebuildUploadData() LLQuaternion identity; if (!bind_rot.isEqualEps(identity, 0.01)) { + // Bind shape matrix is not in standard X-forward orientation. + // Might be good idea to only show this once. It can be spammy. std::ostringstream out; out << "non-identity bind shape rot. mat is "; out << high_lod_model->mSkinInfo.mBindShapeMatrix; @@ -596,13 +599,9 @@ void LLModelPreview::rebuildUploadData() LL_WARNS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, getLoadState() != LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION); - setLoadState(LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION); + load_state = LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION; } } - else if (getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) - { - setLoadState(LLModelLoader::DONE); - } } instance.mTransform = mat; mUploadData.push_back(instance); @@ -634,12 +633,27 @@ void LLModelPreview::rebuildUploadData() LL_INFOS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, true); } - setLoadState(LLModelLoader::ERROR_MATERIALS); + load_state = LLModelLoader::ERROR_MATERIALS; mFMP->childDisable("calculate_btn"); } } } + // Update state for notifications + if (load_state > 0) + { + // encountered issues + setLoadState(load_state); + } + else if (getLoadState() == LLModelLoader::ERROR_MATERIALS + || getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) + { + // This is only valid for these two error types because they are + // only used inside rebuildUploadData() and updateStatusMessages() + // updateStatusMessages() is called after rebuildUploadData() + setLoadState(LLModelLoader::DONE); + } + F32 max_import_scale = (DEFAULT_MAX_PRIM_SCALE - 0.1f) / max_scale; F32 max_axis = llmax(mPreviewScale.mV[0], mPreviewScale.mV[1]);