summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTonya Souther <tonya.souther@gmail.com>2013-02-27 19:27:46 -0600
committerTonya Souther <tonya.souther@gmail.com>2013-02-27 19:27:46 -0600
commitfa7dd433088963a101252884f35fda8094f4a76b (patch)
treeee69b0c83cf12e90843b97e1ff5d0c99b9bc510b
parent8397f620593d3a5c96e2480909868c79c0c4de84 (diff)
Wire up LLMaterialMgr::remove() to edit panel.
-rw-r--r--indra/newview/llpanelface.cpp4
-rw-r--r--indra/newview/llselectmgr.cpp33
-rw-r--r--indra/newview/llselectmgr.h1
3 files changed, 35 insertions, 3 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 5c4c2693f8..ca161a8654 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -1368,10 +1368,10 @@ void LLPanelFace::updateMaterial()
mMaterial.reset();
mMaterialID = LLMaterialID::null;
// Delete existing material entry...
-
+ LLSelectMgr::getInstance()->selectionRemoveMaterial();
// Hold off any further updates till this one's
// acknowledged.
- //mUpdateInFlight = true;
+ mUpdateInFlight = true;
}
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 91d737ee95..94cfdb9f53 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -2017,7 +2017,7 @@ void LLSelectMgr::selectionSetMaterial(LLMaterialPtr material)
{
if (object->permModify())
{
- llinfos << "Putting material on object " << object->getID() << " face " << face << ", material: " << mMaterial->asLLSD() << llendl;
+ LL_INFOS("Materials") << "Putting material on object " << object->getID() << " face " << face << ", material: " << mMaterial->asLLSD() << LL_ENDL;
LLMaterialMgr::getInstance()->put(object->getID(),face,*mMaterial);
object->setTEMaterialParams(face,mMaterial);
}
@@ -2040,6 +2040,37 @@ void LLSelectMgr::selectionSetMaterial(LLMaterialPtr material)
mSelectedObjects->applyToObjects( &func2 );
}
+void LLSelectMgr::selectionRemoveMaterial()
+{
+ struct f1 : public LLSelectedTEFunctor
+ {
+ bool apply(LLViewerObject* object, S32 face)
+ {
+ if (object->permModify())
+ {
+ LL_INFOS("Materials") << "Removing material from object " << object->getID() << " face " << face << LL_ENDL;
+ LLMaterialMgr::getInstance()->remove(object->getID(),face);
+ //object->setTEMaterialParams(face,LLMaterial::null);
+ }
+ return true;
+ }
+ } func1;
+ mSelectedObjects->applyToTEs( &func1 );
+
+ struct f2 : public LLSelectedObjectFunctor
+ {
+ virtual bool apply(LLViewerObject* object)
+ {
+ if (object->permModify())
+ {
+ object->sendTEUpdate();
+ }
+ return true;
+ }
+ } func2;
+ mSelectedObjects->applyToObjects( &func2 );
+}
+
//-----------------------------------------------------------------------------
// findObjectPermissions()
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 65f3ea96e3..9d187f6272 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -543,6 +543,7 @@ public:
void selectionSetIncludeInSearch(bool include_in_search);
void selectionSetGlow(const F32 glow);
void selectionSetMaterial(LLMaterialPtr material);
+ void selectionRemoveMaterial();
void selectionSetObjectPermissions(U8 perm_field, BOOL set, U32 perm_mask, BOOL override = FALSE);
void selectionSetObjectName(const std::string& name);