summaryrefslogtreecommitdiff
path: root/modules/gltf
diff options
context:
space:
mode:
authorK. S. Ernest (iFire) Lee <fire@users.noreply.github.com>2021-06-16 07:43:42 -0700
committerGitHub <noreply@github.com>2021-06-16 07:43:42 -0700
commit479737538b23ff36e81e9e1f6294464bba913e31 (patch)
tree618529ecc636d95dfa9cab1cbfec5424f3610738 /modules/gltf
parent34e308e044b7ac1996d9caf4959dd97276bb6d32 (diff)
parent291e7359725b1fd2491d18a81a3ac97b8481b5e3 (diff)
Merge pull request #49401 from fire/8-weights
Fix 8 bone weights in glTF2
Diffstat (limited to 'modules/gltf')
-rw-r--r--modules/gltf/gltf_document.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index bc4de76344..988a75ac93 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();