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

Inspector can't show 3rd level of nesting for runtime dictionaries/arrays (fixed in master) #25375

Closed
Tracked by #47369
hilfazer opened this issue Jan 27, 2019 · 18 comments · Fixed by #35816
Closed
Tracked by #47369

Comments

@hilfazer
Copy link
Contributor

hilfazer commented Jan 27, 2019

Godot version:

Godot_v3.1-beta2_win64

OS/device including version:

Windows 7 x64 SP1

Issue description:

When i try to expand doubly nested array or dictionary in Inspector it expands for a very brief time and then collapses. Sometimes it doesn't even expand at all.
Debugger expands just fine.

It happens only for runtime variables (from nodes in the Remote Scene). Thnx to pycbouh for spotting this.

Video:
https://www.dropbox.com/s/i07zsgpbpecqeie/GodotInspectorNestingCollapse.avi?dl=0

Steps to reproduce:
Place a breakpoint in _ready() function
Run the project
Try to fully expand "dict" variable in Inspector

Minimal reproduction project:

Dlownload link: https://downgit.github.io/#/home?url=https://github.com/hilfazer/Projects/tree/master/Godot/EngineIssues/InspectorDictionaryCollapse

Github location: https://github.com/hilfazer/Projects/tree/master/Godot/EngineIssues/InspectorDictionaryCollapse

@akien-mga akien-mga added this to the 3.2 milestone Jan 27, 2019
@TicklesTheBrain
Copy link

TicklesTheBrain commented Mar 17, 2019

Just wanted to confirm this is still happening on 3.1 stable on Windows 10. It also sometimes happens with 2nd level nesting as well, although it is way less severe: I'm always able to open it eventually, but ocasionally it requires clicking more than once.

@menip
Copy link
Contributor

menip commented May 29, 2019

Can confirm this is an issue:
NestedDictBug

@hilfazer
Copy link
Contributor Author

hilfazer commented Jun 3, 2019

If only arrays are in play the bug doesn't surface
5LevelsNestedArray

So it's all Dictionary's fault!

@akien-mga
Copy link
Member

Still valid in the current master branch (8450658).

@akien-mga akien-mga modified the milestones: 3.2, 4.0 Nov 19, 2019
@DoubleCakes
Copy link

I'm having this problem too

Steam version 3.1.2

@YuriSizov
Copy link
Contributor

YuriSizov commented May 19, 2020

So I've debugged it a bit and here's what happens.

First of all, the issue only appears in the Inspector for the remote debugger. Nested dictionaries fold and unfold without a problem when checking them in the editor without a running scene (values must be set manually or via a tool script).

Secondly, the issue has nothing to do with folding. The problem is that the inspector node for a dictionary property is perpetually updated. Which causes it to redraw on each frame and as a result folding to appear broken. Same does not happen with arrays. You can put a breakpoint into EditorPropertyArray::update_property(), and it will only trigger if you actually change something (this includes folding).

With EditorPropertyDictionary::update_property() the situation is different. It gets triggered constantly. If you go up the call stack you'll see that this is because on each frame there is a chain of signals that gets triggered informing the Inspector that the property has changed, when in fact nothing has changed.

Problem seems to sparkle from EditorDebuggerInspector::add_object. This check does not pass and the value is overridden, the changed set is updated, and signals are then emitted.

if (bool(Variant::evaluate(Variant::OP_NOT_EQUAL, debugObj->prop_values[pinfo.name], var))) {
debugObj->prop_values[pinfo.name] = var;
changed.insert(pinfo.name);
}

While at the moment of the assignment the var variable contains a correct reference to the Dictionary in question, the debugObj->prop_values[pinfo.name] seems to always contain NULL. It looks like the value is destroyed somewhere after the assignment and thus the debug reference is constantly empty and requires to be updated while the value itself stays the same.

Any ideas where to look for that destruction?

@YuriSizov
Copy link
Contributor

YuriSizov commented May 19, 2020

It turned out, I was reading the debugger wrong. The old value is still there, it just can't be properly compared to the new one.

image

Seems to be related to and possibly fixed by #29222 and #35816 (thanks @bojidar-bg).

@hilfazer hilfazer changed the title Inspector can't show 3rd level of nesting for dictionaries/arrays Inspector can't show 3rd level of nesting for runtime dictionaries/arrays. Jun 4, 2020
@TicklesTheBrain
Copy link

Since #29222 is closed and #35816 is being debated, this issue is still in need of a temporary fix, especially something that could be applied to 3.2

@Calinou Calinou changed the title Inspector can't show 3rd level of nesting for runtime dictionaries/arrays. Inspector can't show 3rd level of nesting for runtime dictionaries/arrays Mar 25, 2021
@svendixon
Copy link

Any progress on this? I'm in 3.3.2 stable on Windows 10 and this still exists. The only work around I see, is to drop a breakpoint in the code and use the debugger just to see the nested dictionary... pretty annoying.

@Calinou
Copy link
Member

Calinou commented Aug 7, 2021

Any progress on this? I'm in 3.3.2 stable on Windows 10 and this still exists. The only work around I see, is to drop a breakpoint in the code and use the debugger just to see the nested dictionary... pretty annoying.

As far as I know, nobody knows how to resolve this bug yet. It may have been fixed in the master branch for 4.0 though.

@YuriSizov
Copy link
Contributor

YuriSizov commented Aug 7, 2021

I don't think that we have a way to compare dictionaries by value yet, even in master.

@MrOutsider
Copy link

Glad I found others have this problem. I independently replicated this bug.
I am on Godot v3.3.3.stable.official

@akien-mga
Copy link
Member

Fixed by #35816.
Screenshot_20211109_135105

@dalexeev
Copy link
Member

Reproduced in 3.4.2. Looks like this fix hasn't been backported from master?

@Calinou
Copy link
Member

Calinou commented Dec 27, 2021

Reproduced in 3.4.2. Looks like this fix hasn't been backported from master?

Reimplementing #35816 for 3.x would break compatibility with existing projects, not to mention there is no way to get the old behavior back: #35816 (comment)

@Calinou
Copy link
Member

Calinou commented Jan 4, 2022

Reopening, as this still needs to be fixed in 3.x.

@Calinou Calinou reopened this Jan 4, 2022
@Calinou Calinou modified the milestones: 4.0, 3.5 Jan 4, 2022
@Calinou Calinou changed the title Inspector can't show 3rd level of nesting for runtime dictionaries/arrays Inspector can't show 3rd level of nesting for runtime dictionaries/arrays (fixed in master) Jan 4, 2022
@akien-mga
Copy link
Member

Well I don't think this will ever be fixed in 3.x, which is why I closed it as fixed in 4.0.
We can keep it open if users want but I wouldn't give false hopes, this is not easy to fix and probably not worth it for 3.x.

@akien-mga
Copy link
Member

Fixed in 3.5 by #60737.

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.