diff options
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 16 |
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 |