summaryrefslogtreecommitdiff
path: root/indra/newview/llmaterialeditor.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-06-23 19:51:11 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-06-24 08:36:50 +0300
commit0bc7fee11fe43281d5d3c97e95249f9c26af0eb1 (patch)
tree0c48f6008806f4865fff8b84d8afb25e0f40fb42 /indra/newview/llmaterialeditor.cpp
parent088ddc28a4954f8e10627deec951a51fda8cb31d (diff)
SL-17640 Materials Upload UI #1
1. Allow 'none' textures 2. Disable 'apply now' buttons 3. Switch from loading dae files to just gltf glb
Diffstat (limited to 'indra/newview/llmaterialeditor.cpp')
-rw-r--r--indra/newview/llmaterialeditor.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index 8b4d3b832b..f4bf400844 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -27,9 +27,12 @@
#include "llviewerprecompiledheaders.h"
#include "llmaterialeditor.h"
+
+#include "llappviewer.h"
#include "llcombobox.h"
+#include "llnotificationsutil.h"
+#include "lltrans.h"
#include "llviewermenufile.h"
-#include "llappviewer.h"
#include "llviewertexture.h"
#include "llselectmgr.h"
#include "llvovolume.h"
@@ -101,6 +104,11 @@ void LLMaterialEditor::setAlphaCutoff(F32 alpha_cutoff)
childSetValue("alpha cutoff", alpha_cutoff);
}
+void LLMaterialEditor::setMaterialName(const std::string &name)
+{
+ setTitle(name);
+}
+
LLUUID LLMaterialEditor::getMetallicRoughnessId()
{
return childGetValue("metallic-roughness texture").asUUID();
@@ -378,13 +386,14 @@ void LLMaterialFilePicker::loadMaterial(const std::string& filename)
if (!loaded)
{
- // TODO: show error_msg to user
+ LLNotificationsUtil::add("CannotUploadMaterial");
return;
}
if (model_in.materials.empty())
{
- // TODO: show error message that materials are missing
+ // materials are missing
+ LLNotificationsUtil::add("CannotUploadMaterial");
return;
}
@@ -446,9 +455,12 @@ void LLMaterialFilePicker::loadMaterial(const std::string& filename)
mME->setMetalnessFactor(material_in.pbrMetallicRoughness.metallicFactor);
mME->setRoughnessFactor(material_in.pbrMetallicRoughness.roughnessFactor);
-
+
mME->setDoubleSided(material_in.doubleSided);
+ std::string new_material = LLTrans::getString("New Material");
+ mME->setMaterialName(new_material);
+
mME->openFloater();
mME->applyToSelection();