From 5e6d4baa48b0104f1f0778d098aa145b8ce368a8 Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Thu, 24 Mar 2022 17:15:23 -0400 Subject: Add GLTF, DAE and FBX importers enforcement for blend shape mask array --- modules/gltf/gltf_document.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/gltf') 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 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); } } -- cgit v1.2.3