summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelface.cpp5
-rw-r--r--indra/newview/llselectmgr.cpp11
-rw-r--r--indra/newview/llselectmgr.h1
-rw-r--r--indra/newview/llviewerobject.cpp25
-rw-r--r--indra/newview/llviewerobject.h2
5 files changed, 39 insertions, 5 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index c4f118fed8..b7d9df6ea6 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -3075,10 +3075,7 @@ void LLPanelFace::onCommitHideWater()
}
else
{
- // reset texture to default plywood
- LLSelectMgr::getInstance()->selectionSetImage(DEFAULT_OBJECT_TEXTURE);
- // reset texture repeats, that might be altered by invisiprim script from wiki
- LLSelectMgr::getInstance()->selectionTexScaleAutofit(2.f);
+ LLSelectMgr::getInstance()->clearWaterExclusion();
}
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index b307de787c..cc88d31aee 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1995,7 +1995,7 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
asset_id = BLANK_MATERIAL_ASSET_ID;
}
}
-
+ objectp->clearTEWaterExclusion(te);
// Blank out most override data on the object and send to server
objectp->setRenderMaterialID(te, asset_id);
@@ -2477,6 +2477,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data)
}
else {
// Add/update media
+ object->clearTEWaterExclusion(te);
object->setTEMediaFlags(te, mMediaFlags);
LLVOVolume *vo = dynamic_cast<LLVOVolume*>(object);
llassert(NULL != vo);
@@ -7724,6 +7725,14 @@ void LLSelectMgr::setAgentHUDZoom(F32 target_zoom, F32 current_zoom)
gAgentCamera.mHUDCurZoom = current_zoom;
}
+void LLSelectMgr::clearWaterExclusion()
+{
+ // reset texture to default plywood
+ LLSelectMgr::getInstance()->selectionSetImage(DEFAULT_OBJECT_TEXTURE);
+ // reset texture repeats, that might be altered by invisiprim script from wiki
+ LLSelectMgr::getInstance()->selectionTexScaleAutofit(2.f);
+}
+
/////////////////////////////////////////////////////////////////////////////
// Object selection iterator helpers
/////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index b70ec3dbea..0dbdc133e3 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -836,6 +836,7 @@ public:
void getAgentHUDZoom(F32 &target_zoom, F32 &current_zoom) const;
void updatePointAt();
+ void clearWaterExclusion();
// Internal list maintenance functions. TODO: Make these private!
void remove(std::vector<LLViewerObject*>& objects);
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 3d88cc5f39..c5e81dd179 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -7682,6 +7682,31 @@ void LLViewerObject::setGLTFAsset(const LLUUID& id)
updateVolume(volume_params);
}
+void LLViewerObject::clearTEWaterExclusion(const U8 te)
+{
+ if (permModify())
+ {
+ LLViewerTexture* image = getTEImage(te);
+ if (image && (IMG_ALPHA_GRAD == image->getID()))
+ {
+ // reset texture to default plywood
+ setTEImage(te, LLViewerTextureManager::getFetchedTexture(DEFAULT_OBJECT_TEXTURE, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE));
+
+ // reset texture repeats, that might be altered by invisiprim script from wiki
+ U32 s_axis, t_axis;
+ if (!LLPrimitive::getTESTAxes(te, &s_axis, &t_axis))
+ {
+ return;
+ }
+ F32 DEFAULT_REPEATS = 2.f;
+ F32 new_s = getScale().mV[s_axis] * DEFAULT_REPEATS;
+ F32 new_t = getScale().mV[t_axis] * DEFAULT_REPEATS;
+
+ setTEScale(te, new_s, new_t);
+ sendTEUpdate();
+ }
+ }
+}
class ObjectPhysicsProperties : public LLHTTPNode
{
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 63458e60ea..2b52ea2076 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -405,6 +405,8 @@ public:
LLViewerTexture *getTENormalMap(const U8 te) const;
LLViewerTexture *getTESpecularMap(const U8 te) const;
+ void clearTEWaterExclusion(const U8 te);
+
bool isImageAlphaBlended(const U8 te) const;
void fitFaceTexture(const U8 face);