Godot: Inspector can't show 3rd level of nesting for runtime dictionaries/arrays.

Created on 27 Jan 2019  路  8Comments  路  Source: godotengine/godot

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:

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

bug confirmed editor

Most helpful comment

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.

https://github.com/godotengine/godot/blob/dee8f8db745e58caedbf49bbc13a2fdcc8fb1da4/editor/debugger/editor_debugger_inspector.cpp#L186-L189

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?

All 8 comments

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.

Can confirm this is an issue:
NestedDictBug

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

So it's all Dictionary's fault!

Still valid in the current master branch (8450658fa).

I'm having this problem too

Steam version 3.1.2

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.

https://github.com/godotengine/godot/blob/dee8f8db745e58caedbf49bbc13a2fdcc8fb1da4/editor/debugger/editor_debugger_inspector.cpp#L186-L189

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?

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).

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

Was this page helpful?
0 / 5 - 0 ratings