summaryrefslogtreecommitdiff
path: root/editor/import
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 /editor/import
parent391633760b0ea292af079287faf79c1aee6d9254 (diff)
Add GLTF, DAE and FBX importers enforcement for blend shape mask array
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/editor_import_collada.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index 3b5a82b2c3..69fa64c24c 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -994,13 +994,12 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ImporterMesh> &p
Array a = p_morph_meshes[mi]->get_surface_arrays(surface);
//add valid weight and bone arrays if they exist, TODO check if they are unique to shape (generally not)
- if (has_weights) {
- a[Mesh::ARRAY_WEIGHTS] = d[Mesh::ARRAY_WEIGHTS];
- a[Mesh::ARRAY_BONES] = d[Mesh::ARRAY_BONES];
+ // Enforce blend shape mask array format
+ for (int mj = 0; mj < Mesh::ARRAY_MAX; mj++) {
+ if (!(Mesh::ARRAY_FORMAT_BLEND_SHAPE_MASK & (1 << mj))) {
+ a[mj] = Variant();
+ }
}
-
- a[Mesh::ARRAY_INDEX] = Variant();
- //a.resize(Mesh::ARRAY_MAX); //no need for index
mr.push_back(a);
}