summaryrefslogtreecommitdiffstats
path: root/scene/3d/skeleton_modifier_3d.cpp
diff options
context:
space:
mode:
authorSpartan322 <Megacake1234@gmail.com>2024-11-12 13:46:08 -0500
committerSpartan322 <Megacake1234@gmail.com>2024-11-12 13:46:59 -0500
commit3a73c6ebd18bff0fa125be58d3ac9c7a63bab61d (patch)
treec7341bd56c977259578b127886c9a88eeef11820 /scene/3d/skeleton_modifier_3d.cpp
parent5094c2a5f7d506b0e685120f14d1df42e1e9d495 (diff)
parentcb411fa960f0b7fdbd97dcdb4c90f9346360ee0e (diff)
downloadredot-engine-3a73c6ebd18bff0fa125be58d3ac9c7a63bab61d.tar.gz
Merge commit godotengine/godot@cb411fa960f0b7fdbd97dcdb4c90f9346360ee0e
Diffstat (limited to 'scene/3d/skeleton_modifier_3d.cpp')
-rw-r--r--scene/3d/skeleton_modifier_3d.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/scene/3d/skeleton_modifier_3d.cpp b/scene/3d/skeleton_modifier_3d.cpp
index eb85639ead..8ffa9296bb 100644
--- a/scene/3d/skeleton_modifier_3d.cpp
+++ b/scene/3d/skeleton_modifier_3d.cpp
@@ -77,6 +77,17 @@ void SkeletonModifier3D::_skeleton_changed(Skeleton3D *p_old, Skeleton3D *p_new)
//
}
+void SkeletonModifier3D::_force_update_skeleton_skin() {
+ if (!is_inside_tree()) {
+ return;
+ }
+ Skeleton3D *skeleton = get_skeleton();
+ if (!skeleton) {
+ return;
+ }
+ skeleton->force_update_deferred();
+}
+
/* Process */
void SkeletonModifier3D::set_active(bool p_active) {
@@ -85,6 +96,7 @@ void SkeletonModifier3D::set_active(bool p_active) {
}
active = p_active;
_set_active(active);
+ _force_update_skeleton_skin();
}
bool SkeletonModifier3D::is_active() const {
@@ -121,6 +133,10 @@ void SkeletonModifier3D::_notification(int p_what) {
case NOTIFICATION_PARENTED: {
_update_skeleton();
} break;
+ case NOTIFICATION_EXIT_TREE:
+ case NOTIFICATION_UNPARENTED: {
+ _force_update_skeleton_skin();
+ } break;
}
}