diff options
-rw-r--r-- | indra/llcommon/llassettype.cpp | 1 | ||||
-rw-r--r-- | indra/llcommon/llassettype.h | 5 | ||||
-rw-r--r-- | indra/llinventory/llfoldertype.h | 4 | ||||
-rw-r--r-- | indra/llinventory/llinventorytype.cpp | 3 | ||||
-rw-r--r-- | indra/llinventory/llinventorytype.h | 5 | ||||
-rw-r--r-- | indra/llprimitive/CMakeLists.txt | 1 | ||||
-rw-r--r-- | indra/llprimitive/llmaterial.cpp | 11 | ||||
-rw-r--r-- | indra/llprimitive/llmaterial.h | 6 | ||||
-rw-r--r-- | indra/llprimitive/llprimitive.cpp | 69 | ||||
-rw-r--r-- | indra/llprimitive/llprimitive.h | 20 | ||||
-rw-r--r-- | indra/llprimitive/tests/llmessagesystem_stub.cpp | 2 | ||||
-rw-r--r-- | indra/llprimitive/tests/llprimitive_test.cpp | 40 | ||||
-rw-r--r-- | indra/llui/llui.h | 3 | ||||
-rw-r--r-- | indra/newview/llpanelface.cpp | 78 | ||||
-rw-r--r-- | indra/newview/llpanelface.h | 4 | ||||
-rw-r--r-- | indra/newview/llviewerassettype.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_tools.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_tools_texture.xml | 31 |
19 files changed, 276 insertions, 17 deletions
diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index e6cc06e8d0..0bb1f1a0fd 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -96,6 +96,7 @@ LLAssetDictionary::LLAssetDictionary() addEntry(LLAssetType::AT_WIDGET, new AssetEntry("WIDGET", "widget", "widget", false, false, false)); addEntry(LLAssetType::AT_PERSON, new AssetEntry("PERSON", "person", "person", false, false, false)); addEntry(LLAssetType::AT_SETTINGS, new AssetEntry("SETTINGS", "settings", "settings blob", true, true, true)); + addEntry(LLAssetType::AT_MATERIAL, new AssetEntry("MATERIAL", "material", "render material", true, true, true)); addEntry(LLAssetType::AT_UNKNOWN, new AssetEntry("UNKNOWN", "invalid", NULL, false, false, false)); addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, FALSE, FALSE, FALSE)); diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index 652c548d59..e8df8574f7 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -127,8 +127,9 @@ public: AT_RESERVED_6 = 55, AT_SETTINGS = 56, // Collection of settings - - AT_COUNT = 57, + AT_MATERIAL = 57, // Render Material + + AT_COUNT = 58, // +*********************************************************+ // | TO ADD AN ELEMENT TO THIS ENUM: | diff --git a/indra/llinventory/llfoldertype.h b/indra/llinventory/llfoldertype.h index 1f174520da..19f4d61b5b 100644 --- a/indra/llinventory/llfoldertype.h +++ b/indra/llinventory/llfoldertype.h @@ -93,9 +93,13 @@ public: FT_SETTINGS = 56, + FT_MATERIAL = 57, + FT_COUNT, FT_NONE = -1 + + // When adding, see note at bottom of LLAssetType::Etype }; static EType lookup(const std::string& type_name); diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index 853ed655f5..57d521429c 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -153,7 +153,8 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_NONE, // 53 AT_RESERVED_4 LLInventoryType::IT_NONE, // 54 AT_RESERVED_5 - LLInventoryType::IT_SETTINGS, // 55 AT_SETTINGS + LLInventoryType::IT_SETTINGS, // 55 AT_SETTINGS <- why doesnt this match the value in llassettype.h? -brad + LLInventoryType::IT_MATERIAL, // 57 AT_MATERIAL }; // static diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index b6e7fb047f..a5543814d8 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -65,7 +65,8 @@ public: IT_WIDGET = 23, IT_PERSON = 24, IT_SETTINGS = 25, - IT_COUNT = 26, + IT_MATERIAL = 26, + IT_COUNT = 27, IT_UNKNOWN = 255, IT_NONE = -1 @@ -118,6 +119,8 @@ public: ICONNAME_SETTINGS_WATER, ICONNAME_SETTINGS_DAY, + ICONNAME_MATERIAL, + ICONNAME_INVALID, ICONNAME_UNKNOWN, ICONNAME_COUNT, diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index 7b6d04b096..fff4d8ef0a 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -90,6 +90,7 @@ if (LL_TESTS) INCLUDE(LLAddBuildTest) SET(llprimitive_TEST_SOURCE_FILES llmediaentry.cpp + llprimitive.cpp ) LL_ADD_PROJECT_UNIT_TESTS(llprimitive "${llprimitive_TEST_SOURCE_FILES}") endif (LL_TESTS) diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index a219ac1450..f546ac1645 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -331,6 +331,17 @@ void LLMaterial::setAlphaMaskCutoff(U8 cutoff) mAlphaMaskCutoff = cutoff; } +LLUUID LLMaterial::getMaterialID() const +{ + // TODO - not null + return LLUUID::null; +} + +void LLMaterial::setMaterialID(const LLUUID &material_id) +{ + // TODO - set +} + LLSD LLMaterial::asLLSD() const { LLSD material_data; diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index d58b7ee812..2f8aafc2cf 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -27,8 +27,6 @@ #ifndef LL_LLMATERIAL_H #define LL_LLMATERIAL_H -#include <boost/shared_ptr.hpp> - #include "llmaterialid.h" #include "llsd.h" #include "v4coloru.h" @@ -54,8 +52,6 @@ public: ALPHA_SHADER_COUNT = 4 } eShaderCount; - - static const U8 DEFAULT_SPECULAR_LIGHT_EXPONENT = ((U8)(0.2f * 255)); static const LLColor4U DEFAULT_SPECULAR_LIGHT_COLOR; static const U8 DEFAULT_ENV_INTENSITY = 0; @@ -119,6 +115,8 @@ public: void setDiffuseAlphaMode(U8 alpha_mode); U8 getAlphaMaskCutoff() const; void setAlphaMaskCutoff(U8 cutoff); + LLUUID getMaterialID() const; + void setMaterialID(LLUUID const & material_id); bool isNull() const; static const LLMaterial null; diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 67c225d25d..c46e5fb3c5 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -39,6 +39,7 @@ #include "llsdutil_math.h" #include "llprimtexturelist.h" #include "llmaterialid.h" +#include "llsdutil.h" /** * exported constants @@ -1690,6 +1691,8 @@ BOOL LLNetworkData::isValid(U16 param_type, U32 size) return (size == 28); case PARAMS_EXTENDED_MESH: return (size == 4); + case PARAMS_RENDER_MATERIAL: + return (size == 16); } return FALSE; @@ -2181,3 +2184,69 @@ bool LLExtendedMeshParams::fromLLSD(LLSD& sd) return false; } + +//============================================================================ + +LLRenderMaterialParams::LLRenderMaterialParams() +{ + mType = PARAMS_RENDER_MATERIAL; +} + +BOOL LLRenderMaterialParams::pack(LLDataPacker &dp) const +{ + return dp.packUUID(mMaterial, "material"); + +// return TRUE; +} + +BOOL LLRenderMaterialParams::unpack(LLDataPacker &dp) +{ + return dp.unpackUUID(mMaterial, "material"); + +// return TRUE; +} + +bool LLRenderMaterialParams::operator==(const LLNetworkData& data) const +{ + if (data.mType != PARAMS_RENDER_MATERIAL) + { + return false; + } + + const LLRenderMaterialParams ¶m = static_cast<const LLRenderMaterialParams&>(data); + + return param.mMaterial == mMaterial; +} + +void LLRenderMaterialParams::copy(const LLNetworkData& data) +{ + llassert_always(data.mType == PARAMS_RENDER_MATERIAL); + const LLRenderMaterialParams ¶m = static_cast<const LLRenderMaterialParams&>(data); + mMaterial = param.mMaterial; +} + +LLSD LLRenderMaterialParams::asLLSD() const +{ + return llsd::map("material", mMaterial); +} + +bool LLRenderMaterialParams::fromLLSD(LLSD& sd) +{ + if (sd.has("material")) + { + setMaterial(sd["material"]); + return true; + } + + return false; +} + +void LLRenderMaterialParams::setMaterial(const LLUUID & id) +{ + mMaterial = id; +} + +LLUUID LLRenderMaterialParams::getMaterial() const +{ + return mMaterial; +} diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 309b18faa9..e23ddd2916 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -107,6 +107,7 @@ public: PARAMS_RESERVED = 0x50, // Used on server-side PARAMS_MESH = 0x60, PARAMS_EXTENDED_MESH = 0x70, + PARAMS_RENDER_MATERIAL = 0x80, }; public: @@ -320,6 +321,25 @@ public: }; +class LLRenderMaterialParams : public LLNetworkData +{ +private: + LLUUID mMaterial; + +public: + LLRenderMaterialParams(); + BOOL pack(LLDataPacker &dp) const override; + BOOL unpack(LLDataPacker &dp) override; + bool operator==(const LLNetworkData& data) const override; + void copy(const LLNetworkData& data) override; + LLSD asLLSD() const; + operator LLSD() const { return asLLSD(); } + bool fromLLSD(LLSD& sd); + + void setMaterial(const LLUUID & id); + LLUUID getMaterial() const; +}; + // This code is not naming-standards compliant. Leaving it like this for // now to make the connection to code in // BOOL packTEMessage(LLDataPacker &dp) const; diff --git a/indra/llprimitive/tests/llmessagesystem_stub.cpp b/indra/llprimitive/tests/llmessagesystem_stub.cpp index 04e70945c4..9006833054 100644 --- a/indra/llprimitive/tests/llmessagesystem_stub.cpp +++ b/indra/llprimitive/tests/llmessagesystem_stub.cpp @@ -25,7 +25,7 @@ #include "linden_common.h" -char * _PREHASH_TextureEntry; +const char * const _PREHASH_TextureEntry = "TextureEntry"; S32 LLMessageSystem::getSizeFast(char const*, char const*) const { diff --git a/indra/llprimitive/tests/llprimitive_test.cpp b/indra/llprimitive/tests/llprimitive_test.cpp index 0d60c7cd15..0ff0795fdc 100644 --- a/indra/llprimitive/tests/llprimitive_test.cpp +++ b/indra/llprimitive/tests/llprimitive_test.cpp @@ -71,6 +71,46 @@ private: S32 mCurrDetailTest; }; +LLMaterialID::LLMaterialID() {} +LLMaterialID::LLMaterialID(LLMaterialID const &m) = default; +LLMaterialID::~LLMaterialID() {} +void LLMaterialID::set(void const*) { } +U8 const * LLMaterialID::get() const { return mID; } + +LLPrimTextureList::LLPrimTextureList() { } +LLPrimTextureList::~LLPrimTextureList() { } +S32 LLPrimTextureList::setBumpMap(const U8 index, const U8 bump) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setOffsetS(const U8 index, const F32 s) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setOffsetT(const U8 index, const F32 t) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry &te) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setRotation(const U8 index, const F32 r) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setBumpShiny(const U8 index, const U8 bump_shiny) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setFullbright(const U8 index, const U8 t) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setMaterialID(const U8 index, const LLMaterialID& pMaterialID) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setMediaFlags(const U8 index, const U8 media_flags) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setMediaTexGen(const U8 index, const U8 media) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setMaterialParams(const U8 index, const LLMaterialPtr pMaterialParams) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setBumpShinyFullbright(const U8 index, const U8 bump) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setID(const U8 index, const LLUUID& id) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setGlow(const U8 index, const F32 glow) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setAlpha(const U8 index, const F32 alpha) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setColor(const U8 index, const LLColor3& color) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setColor(const U8 index, const LLColor4& color) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setScale(const U8 index, const F32 s, const F32 t) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setScaleS(const U8 index, const F32 s) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setScaleT(const U8 index, const F32 t) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setShiny(const U8 index, const U8 shiny) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setOffset(const U8 index, const F32 s, const F32 t) { return TEM_CHANGE_NONE; } +S32 LLPrimTextureList::setTexGen(const U8 index, const U8 texgen) { return TEM_CHANGE_NONE; } + +LLMaterialPtr LLPrimTextureList::getMaterialParams(const U8 index) { return LLMaterialPtr(); } +void LLPrimTextureList::copy(LLPrimTextureList const & ptl) { mEntryList = ptl.mEntryList; } // do we need to call getTexture()->newCopy()? +void LLPrimTextureList::take(LLPrimTextureList &other_list) { } +void LLPrimTextureList::setSize(S32 new_size) { mEntryList.resize(new_size); } +void LLPrimTextureList::setAllIDs(const LLUUID &id) { } +LLTextureEntry * LLPrimTextureList::getTexture(const U8 index) const { return nullptr; } +S32 LLPrimTextureList::size() const { return mEntryList.size(); } + class PRIMITIVE_TEST_SETUP { public: diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 30dbd7248f..86b23c8c93 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -76,7 +76,8 @@ enum EDragAndDropType DAD_WIDGET = 16, DAD_PERSON = 17, DAD_SETTINGS = 18, - DAD_COUNT = 19, // number of types in this enum + DAD_MATERIAL = 19, + DAD_COUNT = 20, // number of types in this enum }; // Reasons for drags to be denied. diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 71657239a6..6b3ca43402 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -123,6 +123,7 @@ F32 LLPanelFace::getCurrentShinyScaleU() { return getChild<LLUICtrl>("shinySca F32 LLPanelFace::getCurrentShinyScaleV() { return getChild<LLUICtrl>("shinyScaleV")->getValue().asReal(); } F32 LLPanelFace::getCurrentShinyOffsetU() { return getChild<LLUICtrl>("shinyOffsetU")->getValue().asReal(); } F32 LLPanelFace::getCurrentShinyOffsetV() { return getChild<LLUICtrl>("shinyOffsetV")->getValue().asReal(); } +LLUUID LLPanelFace::getCurrentMaterialID() { return getChild<LLUICtrl>("materialID")->getValue().asUUID(); } // // Methods @@ -154,9 +155,11 @@ BOOL LLPanelFace::postBuild() childSetCommitCallback("glossiness",&LLPanelFace::onCommitMaterialGloss, this); childSetCommitCallback("environment",&LLPanelFace::onCommitMaterialEnv, this); childSetCommitCallback("maskcutoff",&LLPanelFace::onCommitMaterialMaskCutoff, this); + childSetCommitCallback("materialID", &LLPanelFace::onCommitMaterialID, this); childSetAction("button align",&LLPanelFace::onClickAutoFix,this); childSetAction("button align textures", &LLPanelFace::onAlignTexture, this); + childSetAction("button save material", &LLPanelFace::onSaveMaterial, this); LLTextureCtrl* mTextureCtrl; LLTextureCtrl* mShinyTextureCtrl; @@ -298,7 +301,7 @@ BOOL LLPanelFace::postBuild() { mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this); } - + clearCtrls(); @@ -1409,7 +1412,15 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) LLMaterialPtr material; LLSelectedTEMaterial::getCurrent(material, identical); - if (material && editable) + // enable this UI box if a single face is selected. + BOOL is_single_face = !LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected(); + childSetEnabled("button save material", static_cast<bool>(is_single_face)); + childSetEnabled("materialID", static_cast<bool>(is_single_face)); // doesn't work - why? + + // TODO: 2022-04 conflicts with media button placement. hide the button if applying media + // i.e. childSetVisible("button save material", !applying_media); + + if (material && editable) { LL_DEBUGS("Materials") << material->asLLSD() << LL_ENDL; @@ -1518,6 +1529,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) calcp->setVar(LLCalc::TEX_ROTATION, childGetValue("TexRot").asReal()); calcp->setVar(LLCalc::TEX_TRANSPARENCY, childGetValue("ColorTrans").asReal()); calcp->setVar(LLCalc::TEX_GLOW, childGetValue("glow").asReal()); + + getChildView("materialID")->setEnabled(editable); } else { @@ -2302,6 +2315,13 @@ void LLPanelFace::onCommitMaterialMaskCutoff(LLUICtrl* ctrl, void* userdata) LLSelectedTEMaterial::setAlphaMaskCutoff(self,self->getCurrentAlphaMaskCutoff()); } +//static +void LLPanelFace::onCommitMaterialID(LLUICtrl* ctrl, void* userdata) +{ + LLPanelFace* self = static_cast<LLPanelFace*>(userdata); + LLSelectedTEMaterial::setMaterialID(self, self->getCurrentMaterialID()); +} + // static void LLPanelFace::onCommitTextureInfo( LLUICtrl* ctrl, void* userdata ) { @@ -2538,6 +2558,60 @@ void LLPanelFace::onAlignTexture(void* userdata) self->alignTestureLayer(); } +#include "llagent.h" +#include "llfilesystem.h" +#include "llfloaterperms.h" +#include "llviewerassetupload.h" +#include "llviewermenufile.h" +#include "llsd.h" +#pragma warning (disable: 4189) +void LLPanelFace::onSaveMaterial(void* userdata) +{ + // DRTVWR-559, Q&D material picker - save to inventory goes here + LL_DEBUGS("Material") << "saving material to inventory" << LL_ENDL; + + LLPanelFace* self = (LLPanelFace*)userdata; + + std::string name = "New Material"; + + LLSD* mat_llsd = new LLSD("Surely you jest..."); + // TBD populate mat_llsd with material data + self->onCloseTexturePicker(*mat_llsd); // certainly wrong, but something like this? + + // gen a new uuid for this asset + LLTransactionID tid; + tid.generate(); + LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); + + LLFileSystem fmt_file(new_asset_id, LLAssetType::AT_MATERIAL, LLFileSystem::WRITE); + fmt_file.write(mat_llsd->asBinary().data(), mat_llsd->size()); + + S32 expected_upload_cost = 0;// LLAgentBenefitsMgr::current().getTextureUploadCost(); + + std::string res_name = name; + std::string res_desc = "Saved Material"; + LLFolderType::EType folder_type = LLFolderType::FT_MATERIAL; + LLInventoryType::EType inv_type = LLInventoryType::IT_MATERIAL; + + auto upload_info = new LLResourceUploadInfo( + tid, + LLAssetType::AT_MATERIAL, + res_name, + res_desc, + 0, + folder_type, + inv_type, + PERM_ALL, + LLFloaterPerms::getGroupPerms("Uploads"), + LLFloaterPerms::getEveryonePerms("Uploads"), + expected_upload_cost, + false); + + LLResourceUploadInfo::ptr_t p_upload_info(upload_info); + + upload_new_resource(p_upload_info); +} + // TODO: I don't know who put these in or what these are for??? void LLPanelFace::setMediaURL(const std::string& url) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 2d57d89a44..9282b70b3c 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -191,6 +191,7 @@ protected: static void onCommitMaterialGloss( LLUICtrl* ctrl, void* userdata); static void onCommitMaterialEnv( LLUICtrl* ctrl, void* userdata); static void onCommitMaterialMaskCutoff( LLUICtrl* ctrl, void* userdata); + static void onCommitMaterialID( LLUICtrl* ctrl, void* userdata); static void onCommitMaterialsMedia( LLUICtrl* ctrl, void* userdata); static void onCommitMaterialType( LLUICtrl* ctrl, void* userdata); @@ -204,6 +205,7 @@ protected: static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo); static void onClickAutoFix(void*); static void onAlignTexture(void*); + static void onSaveMaterial(void*); static F32 valueGlow(LLViewerObject* object, S32 face); @@ -233,6 +235,7 @@ private: F32 getCurrentShinyScaleV(); F32 getCurrentShinyOffsetU(); F32 getCurrentShinyOffsetV(); + LLUUID getCurrentMaterialID(); // Update visibility of controls to match current UI mode // (e.g. materials vs media editing) @@ -497,6 +500,7 @@ public: DEF_EDIT_MAT_STATE(LLUUID,const LLUUID&,setNormalID); DEF_EDIT_MAT_STATE(LLUUID,const LLUUID&,setSpecularID); DEF_EDIT_MAT_STATE(LLColor4U, const LLColor4U&,setSpecularLightColor); + DEF_EDIT_MAT_STATE(LLUUID, const LLUUID&, setMaterialID); }; class LLSelectedTE diff --git a/indra/newview/llviewerassettype.cpp b/indra/newview/llviewerassettype.cpp index 4804ef6ddc..481086f760 100644 --- a/indra/newview/llviewerassettype.cpp +++ b/indra/newview/llviewerassettype.cpp @@ -88,6 +88,7 @@ LLViewerAssetDictionary::LLViewerAssetDictionary() addEntry(LLViewerAssetType::AT_NONE, new ViewerAssetEntry(DAD_NONE)); addEntry(LLViewerAssetType::AT_SETTINGS, new ViewerAssetEntry(DAD_SETTINGS)); + addEntry(LLViewerAssetType::AT_MATERIAL, new ViewerAssetEntry(DAD_MATERIAL)); }; EDragAndDropType LLViewerAssetType::lookupDragAndDropType(EType asset_type) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a95636ff23..16b294b8e9 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -6017,6 +6017,11 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para new_block = new LLExtendedMeshParams(); break; } + case LLNetworkData::PARAMS_RENDER_MATERIAL: + { + new_block = new LLRenderMaterialParams(); + break; + } default: { LL_INFOS() << "Unknown param type." << LL_ENDL; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 0abee2ff80..44bdcd86f9 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2,7 +2,7 @@ <floater positioning="cascading" legacy_header_height="18" - height="600" + height="640" layout="topleft" bg_opaque_image="Window_NoTitle_Foreground" bg_alpha_image="Window_NoTitle_Background" @@ -820,7 +820,7 @@ width="282"/> <tab_container follows="left|top" - height="410" + height="460" halign="center" left="0" name="Object Info Tabs" diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index 90f32ae452..85ee736176 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -2,7 +2,7 @@ <panel border="false" follows="all" - height="420" + height="500" label="Texture" layout="topleft" left="0" @@ -772,7 +772,7 @@ width="260" /> <button left="10" - top="222" + top="257" height="20" label="Align" label_selected="Align current texture layers" @@ -793,4 +793,29 @@ height="4" start_url="about:blank" decouple_texture_size="true" /> - </panel> + <button + left="90" + top="222" + height="20" + label="Save as Material" + label_selected="Save current face as a Material" + layout="topleft" + name="button save material" + top_delta="0" + tool_tip="Save material to inventory" + width="110" /> + + <line_editor + enabled="true" + follows="top|left" + height="16" + layout="topleft" + left="7" + label="Material UUID" + name="materialID" + select_on_focus="true" + top="380" + width="200" + tool_tip="UUID for a material asset" + /> +</panel> |