Merge pull request #51798 from nekomatata/fix-skeleton-child-bones

This commit is contained in:
Rémi Verschelde 2021-08-18 00:56:06 +02:00 committed by GitHub
commit b463ac747a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,13 +172,16 @@ 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;