Skip to content

Commit

Permalink
Merge pull request #44745 from adamscott/fix-accessor-normalized
Browse files Browse the repository at this point in the history
Add missing "normalized" accessor property to glTF document
  • Loading branch information
akien-mga authored Dec 28, 2020
2 parents 6fd9a1b + 4771004 commit 5c76225
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@ Error GLTFDocument::_encode_accessors(Ref<GLTFState> state) {
d["count"] = accessor->count;
d["type"] = _get_accessor_type_name(accessor->type);
d["byteOffset"] = accessor->byte_offset;
d["normalized"] = accessor->normalized;
d["max"] = accessor->max;
d["min"] = accessor->min;
d["bufferView"] = accessor->buffer_view; //optional because it may be sparse...
Expand Down Expand Up @@ -961,6 +962,10 @@ Error GLTFDocument::_parse_accessors(Ref<GLTFState> state) {
accessor->byte_offset = d["byteOffset"];
}

if (d.has("normalized")) {
accessor->normalized = d["normalized"];
}

if (d.has("max")) {
accessor->max = d["max"];
}
Expand Down

0 comments on commit 5c76225

Please sign in to comment.