Skip to content

Commit

Permalink
fix bug in anima clear
Browse files Browse the repository at this point in the history
  • Loading branch information
ceceppa committed Sep 12, 2024
1 parent 2c58669 commit 757745d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/anima/core/anima_node.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func _exit_tree():
clear()

for child in get_children():
child.free()
child.queue_free()

func _ready():
if not _anima_tween.is_connected("animation_completed",Callable(self,"_on_all_tween_completed")):
Expand Down Expand Up @@ -793,3 +793,5 @@ func _play_backwards(time: float) -> void:

func debug():
print(get_animation_data())

return self
6 changes: 6 additions & 0 deletions addons/anima/core/declaration/anima_declaration_node.gd
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ func clear():
if _anima_node and is_instance_valid(_anima_node):
_anima_node.clear()

var to_ignore = ['node', 'nodes', 'grid', 'group']
for key in _data.keys():
if not to_ignore.has(key):
_data.erase(key)

_target_data = _data
_clear_metakeys(_target_data.node)

return self
Expand Down

0 comments on commit 757745d

Please sign in to comment.