diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2022-12-09 16:34:28 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2022-12-09 16:34:28 -0500 |
commit | f41278082f2ab204ec60c15ee1530ca4440937a5 (patch) | |
tree | c382bb0e6cde299e853d09b19a47f1d82dc537fa /indra/newview/llpanelface.h | |
parent | fc424a0db90fd2d2e44e85a19750ad6eaa57b28a (diff) | |
parent | e3b34fec6962e6deda3dd9dd83bf9fa20ab594af (diff) |
SL-18809: Merge 'DRTVWR-559' of secondlife/viewer into sl-18809
Diffstat (limited to 'indra/newview/llpanelface.h')
-rw-r--r-- | indra/newview/llpanelface.h | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 69744689b5..c0afc79cbe 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -29,6 +29,7 @@ #include "v4color.h" #include "llpanel.h" +#include "llgltfmaterial.h" #include "llmaterial.h" #include "llmaterialmgr.h" #include "lltextureentry.h" @@ -102,7 +103,7 @@ public: void refreshMedia(); void unloadMedia(); - static void onGLTFMaterialUpdate(const LLUUID& object_id, S32 side); + static void onMaterialOverrideReceived(const LLUUID& object_id, S32 side); /*virtual*/ void draw(); @@ -176,7 +177,6 @@ protected: // // @param force_set_values forces spinners to set value even if they are focused void updateUI(bool force_set_values = false); - void updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool force_set_values); // Convenience func to determine if all faces in selection have // identical planar texgen settings during edits @@ -229,11 +229,13 @@ protected: static void onCommitGlow( LLUICtrl* ctrl, void *userdata); static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata); static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo); + void onCommitGLTFTextureScaleU(LLUICtrl* ctrl); void onCommitGLTFTextureScaleV(LLUICtrl* ctrl); void onCommitGLTFRotation(LLUICtrl* ctrl); void onCommitGLTFTextureOffsetU(LLUICtrl* ctrl); void onCommitGLTFTextureOffsetV(LLUICtrl* ctrl); + static void onClickAutoFix(void*); static void onAlignTexture(void*); static void onClickBtnLoadInvPBR(void* userdata); @@ -291,7 +293,6 @@ private: // Do NOT call updateUI from within this function. // void updateVisibility(); - void updateVisibilityGLTF(); // Hey look everyone, a type-safe alternative to copy and paste! :) // @@ -451,29 +452,62 @@ private: void onTextureSelectionChanged(LLInventoryItem* itemp); void onPbrSelectionChanged(LLInventoryItem* itemp); + void updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool force_set_values); + void updateVisibilityGLTF(); + + void updateSelectedGLTFMaterials(std::function<void(LLGLTFMaterial*)> func); + void updateGLTFTextureTransform(float value, U32 pbr_type, std::function<void(LLGLTFMaterial::TextureTransform*)> edit); + + void setMaterialOverridesFromSelection(); + LLMenuButton* mMenuClipboardColor; LLMenuButton* mMenuClipboardTexture; bool mIsAlpha; - /* These variables interlock processing of materials updates sent to - * the sim. mUpdateInFlight is set to flag that an update has been - * sent to the sim and not acknowledged yet, and cleared when an - * update is received from the sim. mUpdatePending is set when - * there's an update in flight and another UI change has been made - * that needs to be sent as a materials update, and cleared when the - * update is sent. This prevents the sim from getting spammed with - * update messages when, for example, the user holds down the - * up-arrow on a spinner, and avoids running afoul of its throttle. - */ - bool mUpdateInFlight; - bool mUpdatePending; - LLSD mClipboardParams; LLSD mMediaSettings; bool mNeedMediaTitle; + class Selection + { + public: + void connect(); + + // Returns true if the selected objects or sides have changed since + // this was last called, and no object update is pending + bool update(); + + // Prevents update() returning true until the provided object is + // updated. Necessary to prevent controls updating when the mouse is + // held down. + void setObjectUpdatePending(const LLUUID &object_id, S32 side); + + // Callbacks + void onSelectionChanged() { mNeedsSelectionCheck = true; } + void onSelectedObjectUpdated(const LLUUID &object_id, S32 side); + + protected: + void clearObjectUpdatePending(); + bool isObjectUpdatePending() { return mPendingSide != -1; } + + bool compareSelection(); + + bool mChanged = false; + + boost::signals2::scoped_connection mSelectConnection; + bool mNeedsSelectionCheck = true; + S32 mSelectedObjectCount = 0; + LLUUID mSelectedObjectID; + S32 mSelectedSide = -1; + + LLUUID mPendingObjectID; + S32 mPendingSide = -1; + }; + + static Selection sMaterialOverrideSelection; + public: #if defined(DEF_GET_MAT_STATE) #undef DEF_GET_MAT_STATE |