diff options
author | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2021-06-07 12:30:07 -0700 |
---|---|---|
committer | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2021-06-07 14:33:44 -0700 |
commit | 291e7359725b1fd2491d18a81a3ac97b8481b5e3 (patch) | |
tree | 05ef4eebbb1f426286d0f62bde00f8429b79d98e /modules/gltf | |
parent | a19439734e0efcd764b3da81bb238c6cd8c10b6d (diff) |
Fix 8 bone weights in glTF2
Don't spam in glTF2 import either.
Clear() in SurfaceTool does not keep 8 weights.
Diffstat (limited to 'modules/gltf')
-rw-r--r-- | modules/gltf/gltf_document.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index fa93704fd9..8c8d76fa7c 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -2653,10 +2653,10 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) { //must generate mikktspace tangents.. ergh.. Ref<SurfaceTool> st; st.instance(); + st->create_from_triangle_arrays(array); if (a.has("JOINTS_0") && a.has("JOINTS_1")) { st->set_skin_weight_count(SurfaceTool::SKIN_8_WEIGHTS); } - st->create_from_triangle_arrays(array); st->generate_tangents(); array = st->commit_to_arrays(); } @@ -2772,10 +2772,10 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) { if (generate_tangents) { Ref<SurfaceTool> st; st.instance(); + st->create_from_triangle_arrays(array_copy); if (a.has("JOINTS_0") && a.has("JOINTS_1")) { st->set_skin_weight_count(SurfaceTool::SKIN_8_WEIGHTS); } - st->create_from_triangle_arrays(array_copy); st->deindex(); st->generate_tangents(); array_copy = st->commit_to_arrays(); |