### Godot version

0810ecaafdbee3ea747219e6ab3a8de5d2216a09

### System information

Windows 11, Nvidia 3000, firefox

### Issue description

Exporting the gltf file is corrupt in blender.

### Steps to reproduce

1. Open project.
2. Export as glb
3. Open in blender
4. Blender display many warnings

![image](https://user-images.githubusercontent.com/32321/216740742-de662c5c-f5c3-44b5-a36e-8ad33defdbba.png)


### Minimal reproduction project

https://cdn.discordapp.com/attachments/598003845657788438/1071249610896580691/Test_Game_Project.zip


Color weight_1;
						weight_1.r = a[vertex_i * weights_8_count + 4];
						weight_1.g = a[vertex_i * weights_8_count + 5];
						weight_1.b = a[vertex_i * weights_8_count + 6];
						weight_1.a = a[vertex_i * weights_8_count + 7];
						weights_1.write[vertex_i] = weight_1;
					}
					attributes["WEIGHTS_0"] = _encode_accessor_as_weights(p_state, weights_0, true);
					attributes["WEIGHTS_1"] = _encode_accessor_as_weights(p_state, weights_1, true);
				}
			}
			{
				Vector<int32_t> mesh_indices = array[Mesh::ARRAY_INDEX];
				if (mesh_indices.size()) {
					if (primitive_type == Mesh::PRIMITIVE_TRIANGLES) {
						
						const int is = mesh_indices.size();
						for (int k = 0; k < is; k += 3) {
							SWAP(mesh_indices.write[k + 0], mesh_indices.write[k + 2]);
						}
					}
					primitive["indices"] = _encode_accessor_as_ints(p_state, mesh_indices, true);
				} else {
					if (primitive_type == Mesh::PRIMITIVE_TRIANGLES) {
						
						const Vector<Vector3> &vertices = array[Mesh::ARRAY_VERTEX];
						Ref<SurfaceTool> st;
						st.instantiate();
						st->create_from_triangle_arrays(array);
						st->index();