mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 05:04:10 +00:00
Merge pull request #98536 from TokageItLab/fix-deactivation-modifier
Fix Skeleton doesn't update skin after deactivating modifiers when it has only one modifier
This commit is contained in:
commit
cf160747a0
@ -1032,6 +1032,10 @@ Ref<SkinReference> Skeleton3D::register_skin(const Ref<Skin> &p_skin) {
|
|||||||
return skin_ref;
|
return skin_ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Skeleton3D::force_update_deferred() {
|
||||||
|
_make_dirty();
|
||||||
|
}
|
||||||
|
|
||||||
void Skeleton3D::force_update_all_dirty_bones() {
|
void Skeleton3D::force_update_all_dirty_bones() {
|
||||||
if (!dirty) {
|
if (!dirty) {
|
||||||
return;
|
return;
|
||||||
|
@ -284,6 +284,7 @@ public:
|
|||||||
void force_update_all_dirty_bones();
|
void force_update_all_dirty_bones();
|
||||||
void force_update_all_bone_transforms();
|
void force_update_all_bone_transforms();
|
||||||
void force_update_bone_children_transforms(int bone_idx);
|
void force_update_bone_children_transforms(int bone_idx);
|
||||||
|
void force_update_deferred();
|
||||||
|
|
||||||
void set_modifier_callback_mode_process(ModifierCallbackModeProcess p_mode);
|
void set_modifier_callback_mode_process(ModifierCallbackModeProcess p_mode);
|
||||||
ModifierCallbackModeProcess get_modifier_callback_mode_process() const;
|
ModifierCallbackModeProcess get_modifier_callback_mode_process() const;
|
||||||
|
@ -75,6 +75,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 */
|
/* Process */
|
||||||
|
|
||||||
void SkeletonModifier3D::set_active(bool p_active) {
|
void SkeletonModifier3D::set_active(bool p_active) {
|
||||||
@ -83,6 +94,7 @@ void SkeletonModifier3D::set_active(bool p_active) {
|
|||||||
}
|
}
|
||||||
active = p_active;
|
active = p_active;
|
||||||
_set_active(active);
|
_set_active(active);
|
||||||
|
_force_update_skeleton_skin();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SkeletonModifier3D::is_active() const {
|
bool SkeletonModifier3D::is_active() const {
|
||||||
@ -119,6 +131,10 @@ void SkeletonModifier3D::_notification(int p_what) {
|
|||||||
case NOTIFICATION_PARENTED: {
|
case NOTIFICATION_PARENTED: {
|
||||||
_update_skeleton();
|
_update_skeleton();
|
||||||
} break;
|
} break;
|
||||||
|
case NOTIFICATION_EXIT_TREE:
|
||||||
|
case NOTIFICATION_UNPARENTED: {
|
||||||
|
_force_update_skeleton_skin();
|
||||||
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ protected:
|
|||||||
|
|
||||||
void _update_skeleton();
|
void _update_skeleton();
|
||||||
void _update_skeleton_path();
|
void _update_skeleton_path();
|
||||||
|
void _force_update_skeleton_skin();
|
||||||
|
|
||||||
virtual void _skeleton_changed(Skeleton3D *p_old, Skeleton3D *p_new);
|
virtual void _skeleton_changed(Skeleton3D *p_old, Skeleton3D *p_new);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user