summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-08-18 00:56:06 +0200
committerGitHub <noreply@github.com>2021-08-18 00:56:06 +0200
commitb463ac747a22371136b426b42de03fd900a45cd8 (patch)
treee0f5666a4b624353b8311b834f7a65ee69a22e19 /scene
parent2da6641e3d45bcd878bf13eac0cb3a32b7ce4d80 (diff)
parent91fdf7c15b9e60a89916e50d43e66ecc8afca204 (diff)
Merge pull request #51798 from nekomatata/fix-skeleton-child-bones
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/skeleton_3d.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp
index 857916e23d..94fb49ae81 100644
--- a/scene/3d/skeleton_3d.cpp
+++ b/scene/3d/skeleton_3d.cpp
@@ -173,12 +173,15 @@ void Skeleton3D::_update_process_order() {
parentless_bones.clear();
for (int i = 0; i < len; i++) {
+ bonesptr[i].child_bones.clear();
+ }
+
+ for (int i = 0; i < len; i++) {
if (bonesptr[i].parent >= len) {
//validate this just in case
ERR_PRINT("Bone " + itos(i) + " has invalid parent: " + itos(bonesptr[i].parent));
bonesptr[i].parent = -1;
}
- bonesptr[i].child_bones.clear();
if (bonesptr[i].parent != -1) {
int parent_bone_idx = bonesptr[i].parent;