diff options
author | Dave Parks <davep@lindenlab.com> | 2022-09-22 17:27:41 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-09-22 17:27:41 -0500 |
commit | 0afc237de2b3c8286efda25f9ca72aa710bc81ef (patch) | |
tree | 9cb3dd377963500eae8899723a4f6294f952235e /indra/newview/llpanelface.cpp | |
parent | e5d463ca200bdfa93b8c65e588d490c2f23e3918 (diff) | |
parent | 524e5f06b7665cf7b26f451998a418d2cfe9ae13 (diff) |
Merge branch 'DRTVWR-559' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r-- | indra/newview/llpanelface.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 6498215e94..f7eff39da7 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -3632,10 +3632,31 @@ private: struct LLPanelFaceUpdateFunctor : public LLSelectedObjectFunctor { - LLPanelFaceUpdateFunctor(bool update_media) : mUpdateMedia(update_media) {} + LLPanelFaceUpdateFunctor(bool update_media, bool update_pbr) + : mUpdateMedia(update_media) + , mUpdatePbr(update_pbr) + {} + virtual bool apply(LLViewerObject* object) { + if (mUpdatePbr) + { + LLRenderMaterialParams* param_block = (LLRenderMaterialParams*)object->getParameterEntry(LLNetworkData::PARAMS_RENDER_MATERIAL); + if (param_block) + { + if (param_block->isEmpty()) + { + object->setHasRenderMaterialParams(false); + } + else + { + object->parameterChanged(LLNetworkData::PARAMS_RENDER_MATERIAL, true); + } + } + } + object->sendTEUpdate(); + if (mUpdateMedia) { LLVOVolume *vo = dynamic_cast<LLVOVolume*>(object); @@ -3648,6 +3669,7 @@ struct LLPanelFaceUpdateFunctor : public LLSelectedObjectFunctor } private: bool mUpdateMedia; + bool mUpdatePbr; }; struct LLPanelFaceNavigateHomeFunctor : public LLSelectedTEFunctor @@ -3783,7 +3805,7 @@ void LLPanelFace::onPasteColor() LLPanelFacePasteTexFunctor paste_func(this, PASTE_COLOR); selected_objects->applyToTEs(&paste_func); - LLPanelFaceUpdateFunctor sendfunc(false); + LLPanelFaceUpdateFunctor sendfunc(false, false); selected_objects->applyToObjects(&sendfunc); } @@ -3886,6 +3908,7 @@ void LLPanelFace::onCopyTexture() te_data["te"]["bumpmap"] = tep->getBumpmap(); te_data["te"]["bumpshiny"] = tep->getBumpShiny(); te_data["te"]["bumpfullbright"] = tep->getBumpShinyFullbright(); + te_data["te"]["pbr"] = objectp->getRenderMaterialID(te); if (te_data["te"].has("imageid")) { @@ -4139,7 +4162,7 @@ void LLPanelFace::onPasteTexture() LLPanelFacePasteTexFunctor paste_func(this, PASTE_TEXTURE); selected_objects->applyToTEs(&paste_func); - LLPanelFaceUpdateFunctor sendfunc(true); + LLPanelFaceUpdateFunctor sendfunc(true, true); selected_objects->applyToObjects(&sendfunc); LLPanelFaceNavigateHomeFunctor navigate_home_func; @@ -4273,6 +4296,14 @@ void LLPanelFace::onPasteTexture(LLViewerObject* objectp, S32 te) { objectp->setTEBumpShinyFullbright(te, (U8)te_data["te"]["bumpfullbright"].asInteger()); } + if (te_data["te"].has("pbr")) + { + objectp->setRenderMaterialID(te, te_data["te"]["pbr"].asUUID(), false); + } + else + { + objectp->setRenderMaterialID(te, LLUUID::null, false); + } // Texture map if (te_data["te"].has("scales") && te_data["te"].has("scalet")) |