Merge pull request #49182 from timothyqiu/parent-cache

Check cache_parent_physical_bone when rebuilding parent cache
This commit is contained in:
Rémi Verschelde 2021-05-31 12:30:10 +02:00 committed by GitHub
commit 4a97424576
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -698,7 +698,7 @@ void Skeleton3D::_rebuild_physical_bones_cache() {
const int b_size = bones.size();
for (int i = 0; i < b_size; ++i) {
PhysicalBone3D *parent_pb = _get_physical_bone_parent(i);
if (parent_pb != bones[i].physical_bone) {
if (parent_pb != bones[i].cache_parent_physical_bone) {
bones.write[i].cache_parent_physical_bone = parent_pb;
if (bones[i].physical_bone) {
bones[i].physical_bone->_on_bone_parent_changed();