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

Renaming a name present in a NodePath to an invalid name will wrongly update the NodePath #76192

Closed
ajreckof opened this issue Apr 18, 2023 · 7 comments · Fixed by #87252
Closed
Milestone

Comments

@ajreckof
Copy link
Member

Godot version

4.1.dev (4d5f10f)

System information

MacOS 13.3 M1 Pro

Issue description

If you have a NodePath pointing to a node and you rename a node on this path to a value that is already used by one of his siblings, the NodePath will be updated with the value you set while the node will be updated with another unused value created by adding a number after the value you set.

Steps to reproduce

  1. create a root and two children
  2. On the root export a NodePath and set it to one of the children
  3. Rename the referenced child to the name of the other child
  4. now the NodePath points to the other child

Minimal reproduction project

N/A

@nongvantinh
Copy link
Contributor

The latest version of the master branch was tested using v4.1.dev.custom_build [578ca94] and the issue could not be replicated.

The computer's operating system is Microsoft Windows 10 Pro, version 10.0.19045 Build 19045. The system is manufactured by Acer and is a 64-bit PC with an Intel Core i5-8265U CPU @ 1.60GHz, 4 cores, and 8 logical processors. The BIOS version is Insyde Corp. V1.04, 1/15/2019, and the system is in UEFI mode. The computer has 4.00 GB of RAM, with 3.86 GB of total physical memory and 309 MB of available physical memory. The device does not have kernel DMA protection or virtualization-based security, and elevation is required to view device encryption support. The computer's time zone is SE Asia Standard Time. Hyper-V - VM Monitor Mode Extensions, Second Level Address Translation Extensions, Virtualization Enabled in Firmware, and Data Execution Protection are all enabled.

@ajreckof
Copy link
Member Author

ajreckof commented Apr 28, 2023

I can still reproduce on latest master 1becfea

Enregistrement2.mp4

@nongvantinh
Copy link
Contributor

nongvantinh commented Apr 28, 2023

The "Steps to reproduce" that you provided are not the same as the ones in the video, so I was unable to replicate the issue. Nevertheless, thank you for the video. To prevent any confusion in the future, it would be helpful if you could provide a Minimal Reproduction Project.

I have observed that the bug is only present under certain circumstances. Specifically, it occurs when you rename a Node with the same name as one of its siblings, resulting in a conflict. Although the editor detects the issue and automatically appends a number to the end of the new name, the Inspector fails to handle this. I will address this problem over the upcoming weekend, and it should be a quick fix.

@ajreckof
Copy link
Member Author

That is exactly what I described in my first report. The only difference between the video and what I set as steps to reproduce is that I renamed not the pointed node but one that was a parent of the pointed node so that the NodePath would point to a non existent node and it will show an error.
I was going to make a fix at the start of next week but if you feel confident in making a fix, I'll gladly review it. Feel free to ping me when you have done the PR.

@KoBeWi
Copy link
Member

KoBeWi commented Jan 22, 2024

I can't reproduce it on master.

godot.windows.editor.dev.x86_64_Yq4zZlvgHr.mp4

Am I missing something?

@ajreckof
Copy link
Member Author

Did you make sure to use NodePath and not Node?
I can still reproduce on latest master personally

output.mp4

@KoBeWi
Copy link
Member

KoBeWi commented Jan 22, 2024

Ah right, I used Node.

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