diff --git a/tiny_gltf.h b/tiny_gltf.h index ed74f7e..89525bc 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -707,7 +707,6 @@ struct Mesh { std::string name; std::vector primitives; std::vector weights; // weights to be applied to the Morph Targets - std::vector > targets; ExtensionMap extensions; Value extras; @@ -1303,8 +1302,7 @@ bool Material::operator==(const Material &other) const { } bool Mesh::operator==(const Mesh &other) const { return this->extensions == other.extensions && this->extras == other.extras && - this->name == other.name && this->primitives == other.primitives && - this->targets == other.targets && Equals(this->weights, other.weights); + this->name == other.name && this->primitives == other.primitives; } bool Model::operator==(const Model &other) const { return this->accessors == other.accessors && @@ -3382,24 +3380,6 @@ static bool ParseMesh(Mesh *mesh, Model *model, std::string *err, } } - // Look for morph targets - json::const_iterator targetsObject = o.find("targets"); - if ((targetsObject != o.end()) && targetsObject.value().is_array()) { - for (json::const_iterator i = targetsObject.value().begin(); - i != targetsObject.value().end(); i++) { - std::map targetAttribues; - - const json &dict = i.value(); - json::const_iterator dictIt(dict.begin()); - json::const_iterator dictItEnd(dict.end()); - - for (; dictIt != dictItEnd; ++dictIt) { - targetAttribues[dictIt.key()] = static_cast(dictIt.value()); - } - mesh->targets.push_back(targetAttribues); - } - } - // Should probably check if has targets and if dimensions fit ParseNumberArrayProperty(&mesh->weights, err, o, "weights", false); @@ -4911,14 +4891,13 @@ static void SerializeGltfBufferView(BufferView &bufferView, json &o) { } static void SerializeGltfImage(Image &image, json &o) { - // if uri empty, the mimeType and bufferview should be set + // if uri empty, the mimeType and bufferview should be set if (image.uri.empty()) { - SerializeStringProperty("mimeType", image.mimeType, o); - SerializeNumberProperty("bufferView", image.bufferView, o); - } - else { - SerializeStringProperty("uri", image.uri, o); - } + SerializeStringProperty("mimeType", image.mimeType, o); + SerializeNumberProperty("bufferView", image.bufferView, o); + } else { + SerializeStringProperty("uri", image.uri, o); + } if (image.name.size()) { SerializeStringProperty("name", image.name, o);