Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node signal "renamed" is emitted twice for @tool scripts. #102411

Open
DiceWithSpades opened this issue Feb 4, 2025 · 2 comments
Open

Node signal "renamed" is emitted twice for @tool scripts. #102411

DiceWithSpades opened this issue Feb 4, 2025 · 2 comments

Comments

@DiceWithSpades
Copy link

Tested versions

Tested in Godot Engine v4.4.beta2.official.a013481b0

System information

Godot v4.4.beta2 - Linux Mint 22.1 (Xia) on X11 - X11 display driver, Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4060 Laptop GPU - AMD Ryzen 7 8845HS w/ Radeon 780M Graphics (16 threads)

Issue description

When using renamed signal from Node in @tool script it will be emitted twice on single rename operation from Scene dock.

Steps to reproduce

  1. Open project.
  2. Find CustomNode.
  3. Rename node to something else.
  4. It should show RENAMED message in Output dock twice, but it is expected to show only once.

When project is running there should also be button to change node name. It will trigger this Output message only once, but logic stays the same.

Minimal reproduction project (MRP)

issuewithrename.zip

@AThousandShips
Copy link
Member

Can confirm, also happens in 4.3 and 4.2.2

@AThousandShips
Copy link
Member

This is due to this code:

p_node->set_name(new_name);
undo_redo->add_do_method(p_node, "set_name", new_name);

Related to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants