summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-06-25 19:18:23 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-07-01 20:05:31 +0300
commitc7bd4528a7bc295a17a12951389fcc499483f6c5 (patch)
tree34a1f4f5bfe2f559d607f5d6dbaddb895a84aeec /indra
parent59cc1802814eff0742c8051b2d9200a1d4a2dc62 (diff)
viewer#1131 gltf model upload UI WIP
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/gltfscenemanager.cpp2
-rw-r--r--indra/newview/llfloateravatar.cpp5
-rw-r--r--indra/newview/llfloaterdestinations.cpp5
-rw-r--r--indra/newview/llfloaterfonttest.cpp5
-rw-r--r--indra/newview/llfloatergltfasseteditor.cpp111
-rw-r--r--indra/newview/llfloatergltfasseteditor.h114
-rw-r--r--indra/newview/llgltffolderviews.cpp143
-rw-r--r--indra/newview/llgltffolderviews.h110
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/llviewermenu.cpp10
-rw-r--r--indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml21
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml8
13 files changed, 525 insertions, 15 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 3aaeb426da..67bcab86ff 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -219,6 +219,7 @@ set(viewer_SOURCE_FILES
llfloaterfonttest.cpp
llfloaterforgetuser.cpp
llfloatergesture.cpp
+ llfloatergltfasseteditor.cpp
llfloatergodtools.cpp
llfloatergotoline.cpp
llfloatergridstatus.cpp
@@ -313,6 +314,7 @@ set(viewer_SOURCE_FILES
llgesturemgr.cpp
llgiveinventory.cpp
llglsandbox.cpp
+ llgltffolderviews.cpp
llgltfmateriallist.cpp
llgltfmaterialpreviewmgr.cpp
llgroupactions.cpp
@@ -879,6 +881,7 @@ set(viewer_HEADER_FILES
llfloaterfonttest.h
llfloaterforgetuser.h
llfloatergesture.h
+ llfloatergltfasseteditor.h
llfloatergodtools.h
llfloatergotoline.h
llfloatergridstatus.h
@@ -975,6 +978,7 @@ set(viewer_HEADER_FILES
llgesturelistener.h
llgesturemgr.h
llgiveinventory.h
+ llgltffolderviews.h
llgltfmateriallist.h
llgltfmaterialpreviewmgr.h
llgroupactions.h
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index a0cbe9290c..b161ec8492 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -42,6 +42,7 @@
#include "llviewertexturelist.h"
#include "llimagej2c.h"
#include "llfloaterperms.h"
+#include "llfloaterreg.h"
#include "llagentbenefits.h"
#include "llfilesystem.h"
#include "boost/json.hpp"
@@ -314,6 +315,7 @@ void GLTFSceneManager::load(const std::string& filename)
{
mObjects.push_back(obj);
}
+ LLFloaterReg::showInstance("gltf_asset_editor");
}
}
else
diff --git a/indra/newview/llfloateravatar.cpp b/indra/newview/llfloateravatar.cpp
index 6a38d7549c..404316275d 100644
--- a/indra/newview/llfloateravatar.cpp
+++ b/indra/newview/llfloateravatar.cpp
@@ -25,11 +25,6 @@
* $/LicenseInfo$
*/
-/**
- * Floater that appears when buying an object, giving a preview
- * of its contents and their permissions.
- */
-
#include "llviewerprecompiledheaders.h"
#include "llfloateravatar.h"
diff --git a/indra/newview/llfloaterdestinations.cpp b/indra/newview/llfloaterdestinations.cpp
index 93cf02e835..fad9693e8f 100644
--- a/indra/newview/llfloaterdestinations.cpp
+++ b/indra/newview/llfloaterdestinations.cpp
@@ -25,11 +25,6 @@
* $/LicenseInfo$
*/
-/**
- * Floater that appears when buying an object, giving a preview
- * of its contents and their permissions.
- */
-
#include "llviewerprecompiledheaders.h"
#include "llfloaterdestinations.h"
diff --git a/indra/newview/llfloaterfonttest.cpp b/indra/newview/llfloaterfonttest.cpp
index 95d08cb9ce..d39b061d40 100644
--- a/indra/newview/llfloaterfonttest.cpp
+++ b/indra/newview/llfloaterfonttest.cpp
@@ -25,11 +25,6 @@
* $/LicenseInfo$
*/
-/**
- * Floater that appears when buying an object, giving a preview
- * of its contents and their permissions.
- */
-
#include "llviewerprecompiledheaders.h"
#include "llfloaterfonttest.h"
diff --git a/indra/newview/llfloatergltfasseteditor.cpp b/indra/newview/llfloatergltfasseteditor.cpp
new file mode 100644
index 0000000000..a2b5f573bb
--- /dev/null
+++ b/indra/newview/llfloatergltfasseteditor.cpp
@@ -0,0 +1,111 @@
+/**
+ * @file llfloatergltfasseteditor.cpp
+ * @author Brad Payne
+ * @brief LLFloaterFontTest class implementation
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloatergltfasseteditor.h"
+
+#include "llfolderviewitem.h"
+#include "llgltffolderviews.h"
+
+bool LLGLTFSort::operator()(const LLGLTFItem* const& a, const LLGLTFItem* const& b) const
+{
+ // Comparison operator: returns "true" is a comes before b, "false" otherwise
+ S32 compare = LLStringUtil::compareDict(a->getName(), b->getName());
+ return (compare < 0);
+}
+
+/// LLGLTFViewModel
+
+LLGLTFViewModel::LLGLTFViewModel()
+ : base_t(new LLGLTFSort(), new LLGLTFFilter())
+{}
+
+void LLGLTFViewModel::sort(LLFolderViewFolder* folder)
+{
+ base_t::sort(folder);
+}
+
+ /// LLGLTFNode
+// LLUICtrlFactory::create<LLGLTFNode>(params);
+class LLGLTFNode : public LLFolderViewItem
+{
+public:
+ struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
+ {
+ Params();
+ };
+ ~LLGLTFNode();
+protected:
+ LLGLTFNode(const Params& p);
+};
+
+LLGLTFNode::LLGLTFNode(const LLGLTFNode::Params& p)
+ : LLFolderViewItem(p)
+{
+}
+
+LLGLTFNode::~LLGLTFNode()
+{
+}
+
+LLFloaterGltfAssetEditor::LLFloaterGltfAssetEditor(const LLSD& key)
+ : LLFloater(key)
+{
+ setTitle("GLTF Asset Editor (WIP)");
+}
+
+/// LLFloaterGltfAssetEditor
+
+LLFloaterGltfAssetEditor::~LLFloaterGltfAssetEditor()
+{
+}
+
+bool LLFloaterGltfAssetEditor::postBuild()
+{
+ mItemListPanel = getChild<LLPanel>("item_list_panel");
+
+ // Create the root model and view for all conversation sessions
+ LLGLTFItem* base_item = new LLGLTFItem(mGLTFViewModel);
+
+ LLFolderView::Params p(LLUICtrlFactory::getDefaultParams<LLFolderView>());
+ p.name = getName();
+ p.title = getLabel();
+ p.rect = LLRect(0, 0, getRect().getWidth(), 0);
+ p.parent_panel = mItemListPanel;
+ p.tool_tip = p.name;
+ p.listener = base_item;
+ p.view_model = &mGLTFViewModel;
+ p.root = NULL;
+ p.use_ellipses = true;
+ p.options_menu = "menu_gltf.xml"; // *TODO : create this or fix to be optional
+ mConversationsRoot = LLUICtrlFactory::create<LLFolderView>(p);
+ mConversationsRoot->setCallbackRegistrar(&mCommitCallbackRegistrar);
+ mConversationsRoot->setEnableRegistrar(&mEnableCallbackRegistrar);
+
+ return true;
+}
diff --git a/indra/newview/llfloatergltfasseteditor.h b/indra/newview/llfloatergltfasseteditor.h
new file mode 100644
index 0000000000..30000506ae
--- /dev/null
+++ b/indra/newview/llfloatergltfasseteditor.h
@@ -0,0 +1,114 @@
+/**
+ * @file llfloatergltfasseteditor.h
+ * @author Brad Payne
+ * @brief floater to exercise standard fonts
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATERGLTFASSETEDITOR_H
+#define LL_LLFLOATERGLTFASSETEDITOR_H
+
+#include "llfloater.h"
+
+#include "llfolderviewmodel.h"
+#include "llgltffolderviews.h"
+
+class LLGLTFViewModel;
+class LLFolderViewFolder;
+class LLFolderViewModelItem;
+
+class LLGLTFSort
+{
+public:
+ LLGLTFSort() { }
+ bool operator()(const LLGLTFItem* const& a, const LLGLTFItem* const& b) const;
+private:
+};
+
+class LLGLTFFilter : public LLFolderViewFilter
+{
+public:
+ LLGLTFFilter() { mEmpty = ""; }
+ ~LLGLTFFilter() {}
+
+ bool check(const LLFolderViewModelItem* item) { return true; }
+ bool checkFolder(const LLFolderViewModelItem* folder) const { return true; }
+ void setEmptyLookupMessage(const std::string& message) { }
+ std::string getEmptyLookupMessage(bool is_empty_folder = false) const { return mEmpty; }
+ bool showAllResults() const { return true; }
+ std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; }
+ std::string::size_type getFilterStringSize() const { return 0; }
+
+ bool isActive() const { return false; }
+ bool isModified() const { return false; }
+ void clearModified() { }
+ const std::string& getName() const { return mEmpty; }
+ const std::string& getFilterText() { return mEmpty; }
+ void setModified(EFilterModified behavior = FILTER_RESTART) { }
+
+ void resetTime(S32 timeout) { }
+ bool isTimedOut() { return false; }
+
+ bool isDefault() const { return true; }
+ bool isNotDefault() const { return false; }
+ void markDefault() { }
+ void resetDefault() { }
+
+ S32 getCurrentGeneration() const { return 0; }
+ S32 getFirstSuccessGeneration() const { return 0; }
+ S32 getFirstRequiredGeneration() const { return 0; }
+private:
+ std::string mEmpty;
+};
+
+class LLGLTFViewModel
+ : public LLFolderViewModel<LLGLTFSort, LLGLTFItem, LLGLTFItem, LLGLTFFilter>
+{
+public:
+ typedef LLFolderViewModel< LLGLTFSort, LLGLTFItem, LLGLTFItem, LLGLTFFilter> base_t;
+ LLGLTFViewModel();
+
+ void sort(LLFolderViewFolder* folder);
+ bool startDrag(std::vector<LLFolderViewModelItem*>& items) { return false; }
+
+private:
+};
+
+class LLFloaterGltfAssetEditor : public LLFloater
+{
+public:
+ LLFloaterGltfAssetEditor(const LLSD& key);
+ ~LLFloaterGltfAssetEditor();
+
+ bool postBuild() override;
+
+ LLGLTFViewModel& getRootViewModel() { return mGLTFViewModel; }
+
+private:
+ LLGLTFViewModel mGLTFViewModel;
+
+ LLPanel* mItemListPanel = nullptr;
+ LLFolderView* mConversationsRoot = nullptr;
+};
+
+#endif LL_LLFLOATERGLTFASSETEDITOR_H
diff --git a/indra/newview/llgltffolderviews.cpp b/indra/newview/llgltffolderviews.cpp
new file mode 100644
index 0000000000..911b6262ca
--- /dev/null
+++ b/indra/newview/llgltffolderviews.cpp
@@ -0,0 +1,143 @@
+/**
+ * @file llgltffolderviews.cpp
+ * @author Andrey Kleshchev
+ * @brief LLFloaterFontTest class implementation
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llgltffolderviews.h"
+#include "llinventoryicon.h"
+
+/// LLGLTFItem
+
+LLGLTFItem::LLGLTFItem(std::string display_name, LLFolderViewModelInterface& root_view_model)
+ : LLFolderViewModelItemCommon(root_view_model)
+ , mName(display_name)
+{
+ init();
+}
+
+LLGLTFItem::LLGLTFItem(LLFolderViewModelInterface& root_view_model)
+ : LLFolderViewModelItemCommon(root_view_model)
+{
+ init();
+}
+
+LLGLTFItem::~LLGLTFItem()
+{
+
+}
+
+void LLGLTFItem::init()
+{
+ pIcon = LLInventoryIcon::getIcon(LLInventoryType::ICONNAME_OBJECT);
+}
+
+
+bool LLGLTFItem::filterChildItem(LLFolderViewModelItem* item, LLFolderViewFilter& filter)
+{
+ S32 filter_generation = filter.getCurrentGeneration();
+
+ bool continue_filtering = true;
+ if (item)
+ {
+ if (item->getLastFilterGeneration() < filter_generation)
+ {
+ // Recursive application of the filter for child items (CHUI-849)
+ continue_filtering = item->filter(filter);
+ }
+
+ // Update latest generation to pass filter in parent and propagate up to root
+ if (item->passedFilter())
+ {
+ LLGLTFItem* view_model = this;
+
+ while (view_model && view_model->mMostFilteredDescendantGeneration < filter_generation)
+ {
+ view_model->mMostFilteredDescendantGeneration = filter_generation;
+ view_model = static_cast<LLGLTFItem*>(view_model->mParent);
+ }
+ }
+ }
+ return continue_filtering;
+}
+
+bool LLGLTFItem::filter(LLFolderViewFilter& filter)
+{
+
+ const S32 filter_generation = filter.getCurrentGeneration();
+ const S32 must_pass_generation = filter.getFirstRequiredGeneration();
+
+ if (getLastFilterGeneration() >= must_pass_generation
+ && getLastFolderFilterGeneration() >= must_pass_generation
+ && !passedFilter(must_pass_generation))
+ {
+ // failed to pass an earlier filter that was a subset of the current one
+ // go ahead and flag this item as not pass
+ setPassedFilter(false, filter_generation);
+ setPassedFolderFilter(false, filter_generation);
+ return true;
+ }
+
+ bool is_folder = true;
+ const bool passed_filter_folder = is_folder ? filter.checkFolder(this) : true;
+ setPassedFolderFilter(passed_filter_folder, filter_generation);
+
+ bool continue_filtering = true;
+
+ if (!mChildren.empty()
+ && (getLastFilterGeneration() < must_pass_generation // haven't checked descendants against minimum required generation to pass
+ || descendantsPassedFilter(must_pass_generation))) // or at least one descendant has passed the minimum requirement
+ {
+ // now query children
+ for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); iter != end_iter; ++iter)
+ {
+ continue_filtering = filterChildItem((*iter), filter);
+ if (!continue_filtering)
+ {
+ break;
+ }
+ }
+ }
+
+ // If we didn't use all the filter time that means we filtered all of our descendants so we can filter ourselves now
+ if (continue_filtering)
+ {
+ // This is where filter check on the item done (CHUI-849)
+ const bool passed_filter = filter.check(this);
+ if (passed_filter && mChildren.empty() && is_folder) // Update the latest filter generation for empty folders
+ {
+ LLGLTFItem* view_model = this;
+ while (view_model && view_model->mMostFilteredDescendantGeneration < filter_generation)
+ {
+ view_model->mMostFilteredDescendantGeneration = filter_generation;
+ view_model = static_cast<LLGLTFItem*>(view_model->mParent);
+ }
+ }
+ setPassedFilter(passed_filter, filter_generation, filter.getStringMatchOffset(this), filter.getFilterStringSize());
+ continue_filtering = !filter.isTimedOut();
+ }
+ return continue_filtering;
+}
diff --git a/indra/newview/llgltffolderviews.h b/indra/newview/llgltffolderviews.h
new file mode 100644
index 0000000000..294074fd9f
--- /dev/null
+++ b/indra/newview/llgltffolderviews.h
@@ -0,0 +1,110 @@
+/**
+ * @file llgltffolderviews.h
+ * @author Andrey Kleshchev
+ * @brief floater to exercise standard fonts
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATERGLTFFOLDERVIEWS_H
+#define LL_LLFLOATERGLTFFOLDERVIEWS_H
+
+#include "llfloater.h"
+
+#include "llfolderviewmodel.h"
+
+class LLGLTFItem : public LLFolderViewModelItemCommon
+{
+public:
+ LLGLTFItem(std::string display_name, LLFolderViewModelInterface& root_view_model);
+ LLGLTFItem(LLFolderViewModelInterface& root_view_model);
+ virtual ~LLGLTFItem();
+
+ void init();
+
+ const std::string& getName() const override { return mName; }
+ const std::string& getDisplayName() const override { return mName; }
+ const std::string& getSearchableName() const override { return mName; }
+
+ std::string getSearchableDescription() const override { return std::string(); }
+ std::string getSearchableCreatorName()const override { return std::string(); }
+ std::string getSearchableUUIDString() const override { return std::string(); }
+
+ LLPointer<LLUIImage> getIcon() const override { return pIcon; }
+ LLPointer<LLUIImage> getIconOpen() const { return getIcon(); }
+ LLPointer<LLUIImage> getIconOverlay() const { return NULL; }
+
+ LLFontGL::StyleFlags getLabelStyle() const override { return LLFontGL::NORMAL; }
+ std::string getLabelSuffix() const override { return std::string(); }
+
+ void openItem(void) override {}
+ void closeItem(void) override {}
+ void selectItem(void) override {}
+
+ void navigateToFolder(bool new_window = false, bool change_mode = false) override {}
+
+ bool isItemWearable() const { return false; }
+
+ bool isItemRenameable() const override { return false; }
+ bool renameItem(const std::string& new_name) override { return false; }
+
+ bool isItemMovable(void) const override { return false; } // Can be moved to another folder
+ void move(LLFolderViewModelItem* parent_listener) override {}
+
+ bool isItemRemovable(bool check_worn = true) const override { return false; }
+ bool removeItem() override { return false; }
+ void removeBatch(std::vector<LLFolderViewModelItem*>& batch) override {}
+
+ bool isItemCopyable(bool can_copy_as_link = true) const override { return false; }
+ bool copyToClipboard() const override { return false; }
+ bool cutToClipboard() override { return false; }
+ bool isCutToClipboard() { return false; }
+
+ bool isClipboardPasteable() const override { return false; }
+ void pasteFromClipboard() override {}
+ void pasteLinkFromClipboard() override {}
+
+ void buildContextMenu(LLMenuGL& menu, U32 flags) override {};
+
+ bool potentiallyVisible() override { return true; }; // is the item definitely visible or we haven't made up our minds yet?
+
+ bool hasChildren() const override { return mChildren.size() > 0; }
+
+ bool dragOrDrop(
+ MASK mask,
+ bool drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ std::string& tooltip_msg) override
+ {
+ return false;
+ }
+
+ bool filterChildItem(LLFolderViewModelItem* item, LLFolderViewFilter& filter);
+ bool filter(LLFolderViewFilter& filter) override;
+
+private:
+ LLUIImagePtr pIcon;
+ std::string mName;
+};
+
+#endif LL_LLFLOATERGLTFFOLDERVIEWS_H
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index ceda2675d5..36fd1015f6 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -76,6 +76,7 @@
#include "llfloaterfonttest.h"
#include "llfloaterforgetuser.h"
#include "llfloatergesture.h"
+#include "llfloatergltfasseteditor.h"
#include "llfloatergodtools.h"
#include "llfloatergridstatus.h"
#include "llfloatergroups.h"
@@ -372,6 +373,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("forget_username", "floater_forget_user.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterForgetUser>);
LLFloaterReg::add("gestures", "floater_gesture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGesture>);
+ LLFloaterReg::add("gltf_asset_editor", "floater_gltf_asset_editor.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGltfAssetEditor>);
LLFloaterReg::add("god_tools", "floater_god_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGodTools>);
LLFloaterReg::add("grid_status", "floater_grid_status.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGridStatus>);
LLFloaterReg::add("group_picker", "floater_choose_group.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGroupPicker>);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 9a9a316adf..2687938b35 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -8139,6 +8139,15 @@ class LLAdvancedClickGLTFUpload: public view_listener_t
}
};
+class LLAdvancedClickGLTFEdit : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ LLFloaterReg::showInstance("gltf_asset_editor");
+ return true;
+ }
+};
+
class LLAdvancedClickResizeWindow : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -9794,6 +9803,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedClickGLTFOpen(), "Advanced.ClickGLTFOpen");
view_listener_t::addMenu(new LLAdvancedClickGLTFSaveAs(), "Advanced.ClickGLTFSaveAs");
view_listener_t::addMenu(new LLAdvancedClickGLTFUpload(), "Advanced.ClickGLTFUpload");
+ view_listener_t::addMenu(new LLAdvancedClickGLTFEdit(), "Advanced.ClickGLTFEdit");
view_listener_t::addMenu(new LLAdvancedClickResizeWindow(), "Advanced.ClickResizeWindow");
view_listener_t::addMenu(new LLAdvancedPurgeShaderCache(), "Advanced.ClearShaderCache");
view_listener_t::addMenu(new LLAdvancedRebuildTerrain(), "Advanced.RebuildTerrain");
diff --git a/indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml b/indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml
new file mode 100644
index 0000000000..9082486d84
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ can_resize="true"
+ default_tab_group="1"
+ height="891"
+ width="256"
+ min_height="500"
+ min_width="256"
+ layout="topleft"
+ name="gltf asset editor"
+ title="[OBJECT_NAME]">
+ <panel
+ bottom="-1"
+ follows="all"
+ layout="topleft"
+ name="item_list_panel"
+ top_pad="0"
+ left="5"
+ right="-1"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index d5d2d00630..347638249b 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2851,6 +2851,14 @@ function="World.EnvPreset"
<menu_item_call.on_click
function="Advanced.ClickGLTFUpload" />
</menu_item_call>
+ <menu_item_call
+ label="Edit..."
+ name="Edit...">
+ <menu_item_call.on_enable
+ function="EnableGLTFUpload"/>
+ <menu_item_call.on_click
+ function="Advanced.ClickGLTFEdit" />
+ </menu_item_call>
</menu>
<menu
create_jump_keys="true"