summaryrefslogtreecommitdiff
path: root/indra/newview/llgltfmateriallist.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-10-14 17:35:48 -0500
committerDave Parks <davep@lindenlab.com>2022-10-14 17:35:48 -0500
commitf6762c3de57434730a2cbf6d0241bf1db5c9346c (patch)
tree4a112b3ce07552bc19e1c8b4474b64c292572d1f /indra/newview/llgltfmateriallist.cpp
parenta2b09df2db69ba8a2e6b587d839d509fbe5abebb (diff)
SL-18105 Add to/from json capability to LLGLTFMaterial
Diffstat (limited to 'indra/newview/llgltfmateriallist.cpp')
-rw-r--r--indra/newview/llgltfmateriallist.cpp13
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;