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

The Script property appears doubled in the Remote inspector #51077

Closed
ua-knight opened this issue Jul 30, 2021 · 6 comments · Fixed by #55530
Closed

The Script property appears doubled in the Remote inspector #51077

ua-knight opened this issue Jul 30, 2021 · 6 comments · Fixed by #55530

Comments

@ua-knight
Copy link

Godot version

v3.4.beta2.official

System information

Windows 10

Issue description

The script property doubles in the inspector when running the app and selecting 'remote'. Is present on all nodes, in every project, in a new project, after clearing the cache at User/AppData/Roaming/Godot/Projects.

script_doubling_3_4_LI

Steps to reproduce

Create a new, simple, runnable project. Run it and go to the 'Remote tab'. Select any node. In the inspector, the 'script' property is doubled. Occurs both in 3.3.2 and 3.4.beta2.official.

Minimal reproduction project

Test_3_4.zip

@Calinou
Copy link
Member

Calinou commented Jul 30, 2021

, after clearing the cache at User/AppData/Roaming/Godot/Projects.

Are you referring to the app_userdata folder? There is a cache folder within %TEMP% and an user data folder within %APPDATA%. These are not the same thing 🙂

@Calinou Calinou changed the title Script doubling in inspector The Script property appears doubled in the Remote inspector after cleaning app_userdata Jul 30, 2021
@ua-knight
Copy link
Author

ua-knight commented Jul 30, 2021

Sorry. By clearing the cache, I meant removing the project's file at this location:
C:\Users\ulfij\AppData\Roaming\Godot\projects

And to clarify, I also meant that this didn't help. Not that it was a necessary step to reproduce the issue.

@Calinou Calinou changed the title The Script property appears doubled in the Remote inspector after cleaning app_userdata The Script property appears doubled in the Remote inspector Jul 30, 2021
@Calinou
Copy link
Member

Calinou commented Jul 30, 2021

I can confirm this on v3.4.beta.custom_build [d22f487].

Remote inspector

If you create a new GDScript for either of those properties, both properties will appear to have the script resource assigned at the same time. They also both appear to be selected at the same time:

Remote inspector

@belzecue
Copy link

belzecue commented Nov 13, 2021

I just noticed this bug in 3.4-stable, Standard version (Linux).

I did some manual bisecting of releases and can tell you this regression was introduced in 3.2.4.beta2. I'm embarrassed I didn't notice this much earlier.

Here's a screenshot of 3.2.4.beta1 and 3.2.4.beta2. Looks like in beta2 somebody removed the "Script" header, and now the duplicated "Script" properties for a node display together. I'm not sure why a node has (had!) a separate "Script" section when it already had a script property within its Node section. Maybe the person who made the change was trying to resolve that duplication.

In any case, from 3.2.4.beta2 forward we now have those duplicate script properties over/under each other, confusingly.

3.2.4.beta1
3 2 4 beta1 good

3.2.4.beta2
3 2 4 beta2 bad

@Calinou
Copy link
Member

Calinou commented Nov 13, 2021

Here's a screenshot of 3.2.4.beta1 and 3.2.4.beta2. Looks like in beta2 somebody removed the "Script" header, and now the duplicated "Script" properties for a node display together. I'm not sure why a node has (had!) a separate "Script" section when it already had a script property within its Node section. Maybe the person who made the change was trying to resolve that duplication.

Indeed, the Script group was removed in #43566.

@raulsntos
Copy link
Member

I have tested and can confirm this issue is present at least since 3.0.


The inspector gets the properties from an object using the Object::get_property_list method which calls the virtual implementation and then adds some properties (like the script property). For the remote inspector, the object is an instance of ScriptEditorDebuggerInspectedObject which implements the virtual _get_property_list method by returning all of the object's properties (including script) so it gets added twice.

The properties retrieved from the _get_property_list virtual method (the remote properties) are added without a category and the script property that is added by Object::get_property_list at the end is added within the Script category (until #43566 which removes the category), but the script property has always been duplicated.

I can see a two ways to fix this:

  1. Since we know Object::get_property_list will add the script property, the implementation of ScriptEditorDebuggerInspectedObject::_get_property_list can skip the script property and not push it.
  2. The implementation of Object::get_property_list can check if the script property was added by the virtual method and not push it in this case.

I'm not sure which option is preferred.

Note: ScriptEditorDebuggerInspectedObject was renamed to EditorDebuggerRemoteObject in 4.0 but the issue still applies.

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

Successfully merging a pull request may close this issue.

5 participants