GLTF: Don't write unused targetNames on meshes

This commit is contained in:
Aaron Franke 2025-01-08 01:02:14 -08:00
parent 594d64ec24
commit 98e9ace3ef
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF

View file

@ -3193,9 +3193,11 @@ Error GLTFDocument::_serialize_meshes(Ref<GLTFState> p_state) {
primitives.push_back(primitive);
}
Dictionary e;
e["targetNames"] = target_names;
gltf_mesh["extras"] = e;
if (!target_names.is_empty()) {
Dictionary e;
e["targetNames"] = target_names;
gltf_mesh["extras"] = e;
}
_attach_meta_to_extras(import_mesh, gltf_mesh);
weights.resize(target_names.size());