diff options
Diffstat (limited to 'indra/newview/llvocache.cpp')
-rw-r--r-- | indra/newview/llvocache.cpp | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index a92057d010..dd5b9f9fd5 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -85,40 +85,24 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data) // message should be interpreted thusly: /// sides is a list of face indices - // gltf_json is a list of corresponding json + // gltf_llsd is a list of corresponding GLTF override LLSD // any side not represented in "sides" has no override - if (data.has("sides") && data.has("gltf_json")) + if (data.has("sides") && data.has("gltf_llsd")) { LLSD const& sides = data.get("sides"); - LLSD const& gltf_json = data.get("gltf_json"); + LLSD const& gltf_llsd = data.get("gltf_llsd"); - if (sides.isArray() && gltf_json.isArray() && + if (sides.isArray() && gltf_llsd.isArray() && sides.size() != 0 && - sides.size() == gltf_json.size()) + sides.size() == gltf_llsd.size()) { for (int i = 0; i < sides.size(); ++i) { S32 side_idx = sides[i].asInteger(); - std::string gltf_json_str = gltf_json[i].asString(); - mSides[side_idx] = gltf_json_str; + mSides[side_idx] = gltf_llsd[i]; LLGLTFMaterial* override_mat = new LLGLTFMaterial(); - std::string error, warn; - if (override_mat->fromJSON(gltf_json_str, warn, error)) - { - mGLTFMaterial[side_idx] = override_mat; - } - else - { - LL_WARNS() << "Invalid GLTF string: \n" << gltf_json_str << LL_ENDL; - if (!error.empty()) - { - LL_WARNS() << "Error: " << error << LL_ENDL; - } - if (!warn.empty()) - { - LL_WARNS() << "Warning: " << warn << LL_ENDL; - } - } + override_mat->applyOverrideLLSD(gltf_llsd[i]); + mGLTFMaterial[side_idx] = override_mat; } } else @@ -157,7 +141,7 @@ LLSD LLGLTFOverrideCacheEntry::toLLSD() const // check that mSides and mGLTFMaterial have exactly the same keys present llassert(mGLTFMaterial.count(side.first) == 1); data["sides"].append(LLSD::Integer(side.first)); - data["gltf_json"].append(side.second); + data["gltf_llsd"].append(side.second); } return data; |