diff options
author | Dave Parks <davep@lindenlab.com> | 2022-12-16 12:22:35 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-12-16 12:22:35 -0600 |
commit | ad1ecfd9cd1ebedf9aec4a31fd044983b8e0afe8 (patch) | |
tree | 2b5adb931095032ddb7cebf26e5c944b06a8db91 /indra | |
parent | dbc641ce52264d0b5a8e584a726f2df457f26f79 (diff) | |
parent | e07e31af1c8e0c56e5c2e7b91f1f707cc57180f3 (diff) |
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 3f45d4f0da..5c4f7f75bf 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1047,6 +1047,20 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, LL_WARNS() << "LLToolDragAndDrop::dropTextureAllFaces no texture item." << LL_ENDL; return; } + S32 num_faces = hit_obj->getNumTEs(); + bool has_non_pbr_faces = false; + for (S32 face = 0; face < num_faces; face++) + { + if (hit_obj->getRenderMaterialID(face).isNull()) + { + has_non_pbr_faces = true; + break; + } + } + if (!has_non_pbr_faces) + { + return; + } LLUUID asset_id = item->getAssetUUID(); BOOL success = handleDropMaterialProtections(hit_obj, item, source, src_id); if (!success) @@ -1055,13 +1069,14 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, } LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id); add(LLStatViewer::EDIT_TEXTURE, 1); - S32 num_faces = hit_obj->getNumTEs(); for( S32 face = 0; face < num_faces; face++ ) { - - // update viewer side image in anticipation of update from simulator - hit_obj->setTEImage(face, image); - dialog_refresh_all(); + if (hit_obj->getRenderMaterialID(face).isNull()) + { + // update viewer side image in anticipation of update from simulator + hit_obj->setTEImage(face, image); + dialog_refresh_all(); + } } // send the update to the simulator hit_obj->sendTEUpdate(); @@ -1167,6 +1182,10 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, LL_WARNS() << "LLToolDragAndDrop::dropTextureOneFace no texture item." << LL_ENDL; return; } + if (hit_obj->getRenderMaterialID(hit_face).notNull()) + { + return; + } LLUUID asset_id = item->getAssetUUID(); BOOL success = handleDropMaterialProtections(hit_obj, item, source, src_id); if (!success) @@ -2032,6 +2051,31 @@ EAcceptance LLToolDragAndDrop::dad3dApplyToObject( return ACCEPT_NO; } + if (cargo_type == DAD_TEXTURE) + { + if ((mask & MASK_SHIFT)) + { + S32 num_faces = obj->getNumTEs(); + bool has_non_pbr_faces = false; + for (S32 face = 0; face < num_faces; face++) + { + if (obj->getRenderMaterialID(face).isNull()) + { + has_non_pbr_faces = true; + break; + } + } + if (!has_non_pbr_faces) + { + return ACCEPT_NO; + } + } + else if (obj->getRenderMaterialID(face).notNull()) + { + return ACCEPT_NO; + } + } + if(drop && (ACCEPT_YES_SINGLE <= rv)) { if (cargo_type == DAD_TEXTURE) |