summaryrefslogtreecommitdiff
path: root/modules/gltf
diff options
context:
space:
mode:
authorAdam Scott <ascott.ca@gmail.com>2022-03-24 17:15:23 -0400
committerAdam Scott <ascott.ca@gmail.com>2022-03-24 17:15:23 -0400
commit5e6d4baa48b0104f1f0778d098aa145b8ce368a8 (patch)
tree00c1e50b3a88184f82b6b03fdba657599cb525c6 /modules/gltf
parent391633760b0ea292af079287faf79c1aee6d9254 (diff)
Add GLTF, DAE and FBX importers enforcement for blend shape mask array
Diffstat (limited to 'modules/gltf')
-rw-r--r--modules/gltf/gltf_document.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index c70081a620..a8211569eb 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -2907,6 +2907,13 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) {
}
array_copy = blend_surface_tool->commit_to_arrays();
+ // Enforce blend shape mask array format
+ for (int l = 0; l < Mesh::ARRAY_MAX; l++) {
+ if (!(Mesh::ARRAY_FORMAT_BLEND_SHAPE_MASK & (1 << l))) {
+ array_copy[l] = Variant();
+ }
+ }
+
morphs.push_back(array_copy);
}
}