summaryrefslogtreecommitdiff
path: root/indra/newview
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
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')
-rw-r--r--indra/newview/llmaterialeditor.cpp20
-rw-r--r--indra/newview/llmaterialeditor.h2
-rw-r--r--indra/newview/lltexturectrl.cpp16
-rw-r--r--indra/newview/lltexturectrl.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_material_editor.xml40
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml8
6 files changed, 54 insertions, 34 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();
diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h
index e773ecd169..2af4ccf885 100644
--- a/indra/newview/llmaterialeditor.h
+++ b/indra/newview/llmaterialeditor.h
@@ -59,6 +59,8 @@ public:
F32 getAlphaCutoff();
void setAlphaCutoff(F32 alpha_cutoff);
+
+ void setMaterialName(const std::string &name);
LLUUID getMetallicRoughnessId();
void setMetallicRoughnessId(const LLUUID& id);
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 1c4a56b549..b761f34790 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -193,10 +193,8 @@ void LLFloaterTexturePicker::setActive( BOOL active )
void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b)
{
mCanApplyImmediately = b;
- if (!mCanApplyImmediately)
- {
- getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
- }
+
+ getChild<LLUICtrl>("apply_immediate_check")->setValue(mCanApplyImmediately);
updateFilterPermMask();
}
@@ -413,11 +411,7 @@ BOOL LLFloaterTexturePicker::postBuild()
getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("TextureLivePreview"));
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
-
- if (!mCanApplyImmediately)
- {
- getChildView("show_folders_check")->setEnabled(FALSE);
- }
+ getChildView("apply_immediate_check")->setEnabled(mCanApplyImmediately);
getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this);
@@ -483,7 +477,7 @@ void LLFloaterTexturePicker::draw()
}
getChildView("Default")->setEnabled(mImageAssetID != mDefaultImageAssetID || mTentative);
- getChildView("Blank")->setEnabled(mImageAssetID != mBlankImageAssetID || mTentative);
+ getChildView("Blank")->setEnabled((mImageAssetID != mBlankImageAssetID && mBlankImageAssetID != mDefaultImageAssetID) || mTentative);
getChildView("None")->setEnabled(mAllowNoTexture && (!mImageAssetID.isNull() || mTentative));
LLFloater::draw();
@@ -1146,7 +1140,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
mOnCloseCallback(NULL),
mOnSelectCallback(NULL),
mBorderColor( p.border_color() ),
- mAllowNoTexture( FALSE ),
+ mAllowNoTexture( p.allow_no_texture ),
mAllowLocalTexture( TRUE ),
mImmediateFilterPermMask( PERM_NONE ),
mNonImmediateFilterPermMask( PERM_NONE ),
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index 92f6f89af6..1475c8c6fc 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -91,7 +91,7 @@ public:
: image_id("image"),
default_image_id("default_image_id"),
default_image_name("default_image_name"),
- allow_no_texture("allow_no_texture"),
+ allow_no_texture("allow_no_texture", false),
can_apply_immediately("can_apply_immediately"),
no_commit_on_selection("no_commit_on_selection", false),
label_width("label_width", -1),
diff --git a/indra/newview/skins/default/xui/en/floater_material_editor.xml b/indra/newview/skins/default/xui/en/floater_material_editor.xml
index 5d72e6f79d..8482795f6f 100644
--- a/indra/newview/skins/default/xui/en/floater_material_editor.xml
+++ b/indra/newview/skins/default/xui/en/floater_material_editor.xml
@@ -7,8 +7,16 @@
layout="topleft"
name="material editor"
help_topic="material_editor"
- title="Material: [MATERIAL_NAME]"
+ title="[MATERIAL_NAME]"
width="256">
+ <check_box
+ follows="left|top"
+ label="Double Sided"
+ left="14"
+ top="14"
+ name="double sided"
+ height="25"
+ width="120" />
<panel
border="true"
follows="left|top"
@@ -18,7 +26,7 @@
left="5"
mouse_opaque="false"
name="Texture"
- top="20"
+ top_pad="5"
>
<text
type="string"
@@ -31,10 +39,11 @@
width="64">
Albedo:
</text>
- <texture_picker
- can_apply_immediately="true"
+ <texture_picker
+ can_apply_immediately="false"
default_image_name="Default"
fallback_image="materials_ui_x_24.png"
+ allow_no_texture="true"
follows="left|top"
top_pad="8"
height="151"
@@ -55,7 +64,7 @@
Tint
</text>
<color_swatch
- can_apply_immediately="true"
+ can_apply_immediately="false"
follows="left|top"
height="40"
label_height="0"
@@ -170,10 +179,11 @@
>
Metallic-Roughness:
</text>
- <texture_picker
- can_apply_immediately="true"
+ <texture_picker
+ can_apply_immediately="false"
default_image_name="Default"
fallback_image="materials_ui_x_24.png"
+ allow_no_texture="true"
follows="left|top"
width="128"
height="151"
@@ -256,9 +266,10 @@
Emissive:
</text>
<texture_picker
- can_apply_immediately="true"
+ can_apply_immediately="false"
default_image_name="Default"
fallback_image="materials_ui_x_24.png"
+ allow_no_texture="true"
follows="left|top"
top_pad="8"
height="151"
@@ -278,7 +289,7 @@
Tint
</text>
<color_swatch
- can_apply_immediately="true"
+ can_apply_immediately="false"
follows="left|top"
height="40"
label_height="0"
@@ -334,9 +345,10 @@
Normal:
</text>
<texture_picker
- can_apply_immediately="true"
+ can_apply_immediately="false"
default_image_name="Default"
fallback_image="materials_ui_x_24.png"
+ allow_no_texture="true"
follows="left|top"
top_pad="8"
height="151"
@@ -352,14 +364,6 @@
height="25"
width="120" />-->
</panel>
- <check_box
- follows="left|top"
- label="Double Sided"
- left="5"
- top_pad="5"
- name="double sided"
- height="25"
- width="120" />
<button
follows="right|bottom"
height="25"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 786cf32e7a..8670aa92f4 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -9025,6 +9025,14 @@ Unable to upload texture.
[REASON]
<tag>fail</tag>
</notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="CannotUploadMaterial"
+ type="alertmodal">
+There was a problem uploading the file
+ <tag>fail</tag>
+ </notification>
<notification
icon="alertmodal.tga"