You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS/device including version:
Windows 10.0.19041.985
Issue description:
glTF 2.0 permits meshes to assign "weights" to set blend shapes at a default value.
However, EditorSceneImporterMesh does not have an API to assign weights. This problem affects at least glTF. It could also affect COLLADA or FBX if those store the default blend weights.
The code in GLTFDocument::_generate_mesh_instance does the following to assign the blend shape weights onto the mesh:
Ref<EditorSceneImporterMesh> import_mesh = mesh->get_mesh();
if (import_mesh.is_null()) {
return mi;
}
mi->set_mesh(import_mesh);
for (int i = 0; i < mesh->get_blend_weights().size(); i++) {
mi->set("blend_shapes/" + mesh->get_mesh()->get_blend_shape_name(i), mesh->get_blend_weights()[i]);
}
I have verified with a debugger that this code all works. However, mi is an EditorSceneImporterMesh, which does not define properties for blend_shapes/... so that set() call is ignored.
It's a regression because the initial blend weights set by imported glTF files, such as the 0.5 in the example, are being ignored, while it used to work with the old ArrayMesh api.
Without fixing ImporterMeshInstance3D, there isn't an obvious way to store the default blend weights during the import process, up until the final ArrayMesh is generated. ImporterMeshInstance3D is the place that makes sense.
Godot version:
4.0.dev 45d3b96
OS/device including version:
Windows 10.0.19041.985
Issue description:
glTF 2.0 permits meshes to assign "weights" to set blend shapes at a default value.
However, EditorSceneImporterMesh does not have an API to assign weights. This problem affects at least glTF. It could also affect COLLADA or FBX if those store the default blend weights.
The code in
GLTFDocument::_generate_mesh_instance
does the following to assign the blend shape weights onto the mesh:I have verified with a debugger that this code all works. However,
mi
is anEditorSceneImporterMesh
, which does not define properties forblend_shapes/
... so that set() call is ignored.The sample glTF model uses the following JSON:
Steps to reproduce:
Minimal reproduction project:
gltf_khronos_morph_primitives.zip
The text was updated successfully, but these errors were encountered: