Prototype a SaveMaterial button

meow-7.2.2
Dave Houlton 2022-04-27 11:42:02 -06:00
parent a3ffa9f006
commit c4625d26e5
3 changed files with 29 additions and 2 deletions

View File

@ -157,6 +157,7 @@ BOOL LLPanelFace::postBuild()
childSetAction("button align",&LLPanelFace::onClickAutoFix,this);
childSetAction("button align textures", &LLPanelFace::onAlignTexture, this);
childSetAction("button save material", &LLPanelFace::onSaveMaterial, this);
LLTextureCtrl* mTextureCtrl;
LLTextureCtrl* mShinyTextureCtrl;
@ -1409,7 +1410,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
LLMaterialPtr material;
LLSelectedTEMaterial::getCurrent(material, identical);
if (material && editable)
// QUICKHACK - enable this UI box, indiscriminatly. TODO discriminate DJH 2022-04
childSetEnabled("button save material", true);
if (material && editable)
{
LL_DEBUGS("Materials") << material->asLLSD() << LL_ENDL;
@ -2538,6 +2542,16 @@ void LLPanelFace::onAlignTexture(void* userdata)
self->alignTestureLayer();
}
void LLPanelFace::onSaveMaterial(void* userdata)
{
LLPanelFace* self = (LLPanelFace*)userdata;
// DRTVWR-559, Q&D material picker - save to inventory goes here
auto bound = self->getBoundingRect();
self->setUseBoundingRect(self->getUseBoundingRect());
//self->saveMaterialToInventory();
}
// TODO: I don't know who put these in or what these are for???
void LLPanelFace::setMediaURL(const std::string& url)

View File

@ -204,6 +204,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);

View File

@ -793,4 +793,16 @@
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" />
</panel>