summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-07 23:13:04 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-07 23:13:04 +0300
commitbce11a1fa03b95782378ecb431850f77f762a348 (patch)
tree8b5d55ab76e394a8b2e2bd6a17270c92d2851c18
parenteffb14913b7b5fd7024528ccab5df6fa030e7581 (diff)
SL-19958 An inventory material without asset should default to a blank material
A New Material created in Inventory should be immediately usable.
-rw-r--r--indra/newview/lltooldraganddrop.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 6633951db3..4705970c7b 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -40,6 +40,7 @@
#include "llfloatertools.h"
#include "llgesturemgr.h"
#include "llgiveinventory.h"
+#include "llgltfmateriallist.h"
#include "llhudmanager.h"
#include "llhudeffecttrail.h"
#include "llimview.h"
@@ -1095,12 +1096,17 @@ void LLToolDragAndDrop::dropMaterialOneFace(LLViewerObject* hit_obj,
LL_WARNS() << "LLToolDragAndDrop::dropTextureOneFace no material item." << LL_ENDL;
return;
}
- LLUUID asset_id = item->getAssetUUID();
BOOL success = handleDropMaterialProtections(hit_obj, item, source, src_id);
if (!success)
{
return;
}
+ LLUUID asset_id = item->getAssetUUID();
+ if (asset_id.isNull())
+ {
+ // use blank material
+ asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID;
+ }
hit_obj->setRenderMaterialID(hit_face, asset_id);
@@ -1121,13 +1127,19 @@ void LLToolDragAndDrop::dropMaterialAllFaces(LLViewerObject* hit_obj,
LL_WARNS() << "LLToolDragAndDrop::dropTextureAllFaces no material item." << LL_ENDL;
return;
}
- LLUUID asset_id = item->getAssetUUID();
BOOL success = handleDropMaterialProtections(hit_obj, item, source, src_id);
if (!success)
{
return;
}
+ LLUUID asset_id = item->getAssetUUID();
+ if (asset_id.isNull())
+ {
+ // use blank material
+ asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID;
+ }
+
hit_obj->setRenderMaterialIDs(asset_id);
dialog_refresh_all();
// send the update to the simulator