diff options
| author | Dave Parks <davep@lindenlab.com> | 2022-10-21 16:34:14 -0500 |
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2022-10-21 16:34:14 -0500 |
| commit | 61967623baaa8988f4f8b48043f79be29452ca80 (patch) | |
| tree | e35ef542a804e4acd11baa1d0bee989e97582989 /indra/newview/llmaterialeditor.cpp | |
| parent | 24fb2f83362f3aaffed42360f750bc4c82037c39 (diff) | |
SL-18105 Clean up class1/deferred/materialF.glsl (merge cleanup), make override messaging LLSD where it ought to be and JSON where it ought to be.
Diffstat (limited to 'indra/newview/llmaterialeditor.cpp')
| -rw-r--r-- | indra/newview/llmaterialeditor.cpp | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index c5cdb81d67..58894dbd69 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1872,42 +1872,24 @@ public: bool apply(LLViewerObject* objectp, S32 te) override { + // post override from given object and te to the simulator + // requestData should have: + // object_id - UUID of LLViewerObject + // side - S32 index of texture entry + // gltf_json - String of GLTF json for override data + if (objectp && objectp->permModify() && objectp->getVolume()) { - //LLVOVolume* vobjp = (LLVOVolume*)objectp; - S32 local_id = objectp->getLocalID(); - LLPointer<LLGLTFMaterial> material = new LLGLTFMaterial(); - LLPointer<LLGLTFMaterial> base; + mEditor->getGLTFMaterial(material); - tinygltf::Model model_out; - - if(mAssetID != LLUUID::null) - { - base = gGLTFMaterialList.getMaterial(mAssetID); - material->writeOverridesToModel(model_out, 0, base); - } - else - { - material->writeToModel(model_out, 0); - } - - std::string overrides_json; - { - tinygltf::TinyGLTF gltf; - std::ostringstream str; - - gltf.WriteGltfSceneToStream(&model_out, str, false, false); - - overrides_json = str.str(); - LL_DEBUGS() << "overrides_json " << overrides_json << LL_ENDL; - } - + std::string overrides_json = material->asJSON(); + LLSD overrides = llsd::map( - "local_id", local_id, + "object_id", objectp->getID(), "side", te, - "overrides", overrides_json + "gltf_json", overrides_json ); LLCoros::instance().launch("modifyMaterialCoro", std::bind(&LLMaterialEditor::modifyMaterialCoro, mEditor, mCapUrl, overrides)); } |
