diff options
author | Dave Parks <davep@lindenlab.com> | 2022-10-14 17:35:48 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-10-14 17:35:48 -0500 |
commit | f6762c3de57434730a2cbf6d0241bf1db5c9346c (patch) | |
tree | 4a112b3ce07552bc19e1c8b4474b64c292572d1f /indra/newview/llgltfmateriallist.cpp | |
parent | a2b09df2db69ba8a2e6b587d839d509fbe5abebb (diff) |
SL-18105 Add to/from json capability to LLGLTFMaterial
Diffstat (limited to 'indra/newview/llgltfmateriallist.cpp')
-rw-r--r-- | indra/newview/llgltfmateriallist.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 5cbf853179..a5d2be2d4e 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -83,18 +83,9 @@ LLGLTFMaterial* LLGLTFMaterialList::getMaterial(const LLUUID& id) { std::string data = asset["data"]; - tinygltf::TinyGLTF gltf; - tinygltf::TinyGLTF loader; - std::string error_msg; - std::string warn_msg; + std::string warn_msg, error_msg; - tinygltf::Model model_in; - - if (loader.LoadASCIIFromString(&model_in, &error_msg, &warn_msg, data.c_str(), data.length(), "")) - { - LLTinyGLTFHelper::setFromModel(mat, model_in, 0); - } - else + if (!mat->fromJSON(data, warn_msg, error_msg)) { LL_WARNS() << "Failed to decode material asset: " << LL_ENDL; LL_WARNS() << warn_msg << LL_ENDL; |