diff options
Diffstat (limited to 'indra/newview/llmaterialeditor.h')
-rw-r--r-- | indra/newview/llmaterialeditor.h | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h index 7f9c6c0b63..4090ed120b 100644 --- a/indra/newview/llmaterialeditor.h +++ b/indra/newview/llmaterialeditor.h @@ -26,22 +26,62 @@ #pragma once -#include "llfloater.h" +#include "llpreview.h" +#include "llvoinventorylistener.h" class LLTextureCtrl; -class LLMaterialEditor : public LLFloater +namespace tinygltf +{ + class Model; +} + +class LLGLTFMaterial; + +class LLMaterialEditor : public LLPreview, public LLVOInventoryListener { public: LLMaterialEditor(const LLSD& key); + bool setFromGltfModel(tinygltf::Model& model, bool set_textures = false); + // open a file dialog and select a gltf/glb file for import void importMaterial(); // for live preview, apply current material to currently selected object void applyToSelection(); + void getGLTFMaterial(LLGLTFMaterial* mat); + + void setFromGLTFMaterial(LLGLTFMaterial* mat); + + void loadAsset(); + + static void onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status); + + void inventoryChanged(LLViewerObject* object, LLInventoryObject::object_list_t* inventory, S32 serial_num, void* user_data) override; + void onClickSave(); + + // get a dump of the json representation of the current state of the editor UI in GLTF format + std::string getGLTFJson(bool prettyprint = true); + + void getGLBData(std::vector<U8>& data); + + void getGLTFModel(tinygltf::Model& model); + + std::string getEncodedAsset(); + + bool decodeAsset(const std::vector<char>& buffer); + + bool saveIfNeeded(LLInventoryItem* copyitem = nullptr, bool sync = true); + + static void finishInventoryUpload(LLUUID itemId, LLUUID newAssetId, LLUUID newItemId); + + static void finishTaskUpload(LLUUID itemId, LLUUID newAssetId, LLUUID taskId); + + void refreshFromInventory(const LLUUID& new_item_id = LLUUID::null); + void onClickSaveAs(); void onSaveAsMsgCallback(const LLSD& notification, const LLSD& response); void onClickCancel(); @@ -60,7 +100,8 @@ public: void setAlbedoColor(const LLColor4& color); F32 getTransparency(); - + void setTransparency(F32 transparency); + std::string getAlphaMode(); void setAlphaMode(const std::string& alpha_mode); @@ -98,6 +139,9 @@ public: void onCommitNormalTexture(LLUICtrl* ctrl, const LLSD& data); private: + LLUUID mAssetID; + LLUUID mObjectID; + LLTextureCtrl* mAlbedoTextureCtrl; LLTextureCtrl* mMetallicTextureCtrl; LLTextureCtrl* mEmissiveTextureCtrl; |