-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Fix error when having BoneAttachment before PhysicalBone #67698
Conversation
Might be worth reviewing at the same time whether this should be a |
aa77888
to
0c4c682
Compare
Updated and replaced the |
return; // Doesn't exist in the first place. | ||
} | ||
|
||
bones.write[p_bone].nodes_bound.remove(index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the nodes_bound
required to be in order? If not, we can maybe use remove_unordered()
.. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skeleton
itself does not require some specific order. But changing nodes_bound
order affect the order of the returned array from get_bound_child_nodes_to_bone()
and the bound_children
property. So using remove_unordered()
might break user code I think.
0c4c682
to
3acc077
Compare
Thanks! |
Cherry-picked for 3.5.2 |
Fixes #42010
bind_child_node_to_bone()
allows re-adding an existing bind. Butunbind_child_node_from_bone()
does not have extra checks for unbinding a non-existing bindings. SoList::erase()
complains about erasing something that does not exist.There's no error when no
BoneAttachment
node comes before aPhysicalBone
. This is because callingList::erase()
on an empty list won't print an error. (Bone attachments are also bind to bones, so when there's a bone attachment node before the physical bone, the bind node list is not empty when it enters tree.)It's inconsistent that
List::erase()
behaves differently when empty and non-empty. But I think fixing this onSkeleton
level is acceptable since we prefer local solutions 😛There're no such methods on
master
.