Godot: AnimationPlayer emiting signal in the editor

Created on 29 Nov 2017  Â·  12Comments  Â·  Source: godotengine/godot

Windows 10, Godot 2.1.4

I think the the AnimationPlayer finished signal is being emitted within the editor without we set any tool script.

I made a simple scene connecting the finished signal to the queue_free of the root node of the scene. When I play the animation, both through the end and to the beginning, Godot crashes.

Steps to reproduce:

  1. Create a scene with a Label
  2. Add an AnimationPlayer as child
  3. Create an animation
  4. Connect finished signal to the queue_free method using the editor interface
  5. Play the animation
archived bug editor

Most helpful comment

maybe we could avoid emitting signals conneted from the editor while
running from the editor, those are marked as persisting anyway

On Wed, Nov 29, 2017 at 10:26 AM, Henrique Campos notifications@github.com
wrote:

Nope, tried with a Sprite and it also triggers the queue_free with its
texture_changed signal.

So maybe...check for ! is_editor to queue_free nodes?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/13394#issuecomment-347859548,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2witGWBnOeSOPJ6aW37QdvMVXfIhks5s7VuQgaJpZM4QuuxR
.

All 12 comments

that is expected, there is no reason why it should not do that

On Wed, Nov 29, 2017 at 7:25 AM, Henrique Campos notifications@github.com
wrote:

Windows 10, Godot 2.1.4

I think the the AnimationPlayer finished signal is being emitted within
the editor without we set any tool script.

I made a simple scene connecting the finished signal to the queue_free of
the root node of the scene. When I play the animation, both through the
end and to the beginning, Godot crashes.

Steps to reproduce:

  1. Create a scene with a Label
  2. Add an AnimationPlayer as child
  3. Create an animation
  4. Connect finished signal to the queue_free method using the editor
    interface
  5. Play the animation

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/13394, or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2ysiOtajl3uz3FQPnwsR2C-ig_53ks5s7TEvgaJpZM4QuuxR
.

but i see the problem :P

best is to add a call keyframe instead of connecting the signal

On Wed, Nov 29, 2017 at 10:01 AM, Juan Linietsky reduzio@gmail.com wrote:

that is expected, there is no reason why it should not do that

On Wed, Nov 29, 2017 at 7:25 AM, Henrique Campos <[email protected]

wrote:

Windows 10, Godot 2.1.4

I think the the AnimationPlayer finished signal is being emitted within
the editor without we set any tool script.

I made a simple scene connecting the finished signal to the queue_free
of the root node of the scene. When I play the animation, both through the
end and to the beginning, Godot crashes.

Steps to reproduce:

  1. Create a scene with a Label
  2. Add an AnimationPlayer as child
  3. Create an animation
  4. Connect finished signal to the queue_free method using the editor
    interface
  5. Play the animation

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/13394, or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2ysiOtajl3uz3FQPnwsR2C-ig_53ks5s7TEvgaJpZM4QuuxR
.

This isn't expected really, it shouldn't emit it into the editor, or at least the node shouldn't be freed in the editor. The editor crashes, I guess, because of the freed root. But it strange that it is being triggered without a tool script, as far as I know, AnimationPlayer is the only node that triggers that.

Nope, tried with a Sprite and it also triggers the queue_free with its texture_changed signal.

So maybe...check for ! is_editor_hint to queue_free nodes?

I tested it with a child node, Godot doesn't crash but the node is freed from the editor's SceneTree
bug_demo

maybe we could avoid emitting signals conneted from the editor while
running from the editor, those are marked as persisting anyway

On Wed, Nov 29, 2017 at 10:26 AM, Henrique Campos notifications@github.com
wrote:

Nope, tried with a Sprite and it also triggers the queue_free with its
texture_changed signal.

So maybe...check for ! is_editor to queue_free nodes?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/13394#issuecomment-347859548,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2witGWBnOeSOPJ6aW37QdvMVXfIhks5s7VuQgaJpZM4QuuxR
.

Seems like the perfect solution. Would it work for tool scripts?

I mean, if I connect a signal within the editor but call a method in a tool script, will this method be called?

when you connect by code, the persist flag is not set by default, so there
should be no problem

On Wed, Nov 29, 2017 at 10:36 AM, Henrique Campos notifications@github.com
wrote:

Seems like the perfect solution. Would it work for tool scripts?

I mean, if I connect a signal within the editor but call a method in a
tool script, will this method be called?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/13394#issuecomment-347861965,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z29mir8LDNTamboXcSZ6tC9QAiIlXks5s7V3FgaJpZM4QuuxR
.

But the signal would be connected through the editor, only the method would be in code. I think I misexpressed myself :P

the fix is just making connnections with the persist flag not emit in editor mode

or maybe not, if you make a plugin using the editor itself to edit the UI, that will make it stop working, so i am not very sure.

Maybe let users set a flag to tell if the signal shall be executed in the editor?

I think it would be convenient to add just a CheckButton while connecting signals using the editor's interface, there's plenty of space to use it. And use it as an extra argument for connect ?

Duplicate of #13070.

Was this page helpful?
0 / 5 - 0 ratings