diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index c3c37141ed..9f9e39527f 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -63,6 +63,7 @@ #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llinventorymodel.h" +#include "llmaterialmgr.h" #include "llmenugl.h" #include "llmeshrepository.h" #include "llmutelist.h" @@ -2009,6 +2010,37 @@ void LLSelectMgr::selectionSetGlow(F32 glow) mSelectedObjects->applyToObjects( &func2 ); } +void LLSelectMgr::selectionSetMaterial(LLMaterial& material) +{ + struct f1 : public LLSelectedTEFunctor + { + LLMaterial mMaterial; + f1(LLMaterial material) : mMaterial(material) {}; + bool apply(LLViewerObject* object, S32 face) + { + if (object->permModify()) + { + LLMaterialMgr::getInstance()->put(object->getID(),face,mMaterial); + } + return true; + } + } func1(material); + mSelectedObjects->applyToTEs( &func1 ); + + struct f2 : public LLSelectedObjectFunctor + { + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->sendTEUpdate(); + } + return true; + } + } func2; + mSelectedObjects->applyToObjects( &func2 ); +} + //----------------------------------------------------------------------------- // findObjectPermissions() |