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

Resource on dictionary not represented correctly in the inspector. It shows as a number instead of an object #92533

Closed
zzzamo opened this issue May 30, 2024 · 6 comments · Fixed by #94610

Comments

@zzzamo
Copy link

zzzamo commented May 30, 2024

Tested versions

Issue is present in Godot_v4.3-dev6
I tested on Godot_v4.2.2-stable and it works Ok

System information

Windows 10 - Godot_v4.3-dev6

Issue description

Whenever I try adding Resource to a Dictionary it brings me this error

editor/editor_properties.cpp:1328 - Cannot reliably represent '-9223372002008496859' in the inspector, value is too large.

Steps to reproduce

  1. Add new Node
  2. Add a new script to the node
  3. Add 2 exports to the script and use _ready to assign resource to a value in the dictionary
extends Node

@export var dictionary:Dictionary
@export var resource:Resource

func _ready() -> void:
	dictionary[0] = resource
  1. create new tres file from a Resource
  2. put newly created tres file on the inspector under resource variable on node
  3. run the application
  4. go to remote tab on scene
  5. select the node and look for the dictionary variable
  6. expand it
  7. you'll get the error mentioned before

Minimal reproduction project (MRP)

new-game-project.zip

@matheusmdx
Copy link
Contributor

Bisecting points to #88231 as the culprit:
image


Here is how the inspector would look in a normal build:
Captura 2024-06-07 19-17-47-625220


And here how is looking with this bug:
Captura 2024-06-07 19-18-45-399819


And the warning spam:
Captura 2024-06-07 19-18-51-999889

@dalexeev
Copy link
Member

CC @ajreckof @KoBeWi

@ajreckof
Copy link
Member

I'm on vacation en and can't debug it. I'll handle it when coming back on the 20. But if someone wish to look into it before hand this looks like an object being represented as RID and the inspector not detecting it properly and dealing with it as a number hence the warning.

@zzzamo zzzamo changed the title Resource on Dictionary Resource on dictionary not represented correctly in the inspector. It shows as a number instead of an object Jul 12, 2024
@zzzamo
Copy link
Author

zzzamo commented Jul 12, 2024

Changed the title on the bug to be more detailed

@KoBeWi
Copy link
Member

KoBeWi commented Jul 19, 2024

It only happens at runtime. The Resource shows correctly in the editor.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 19, 2024

I tracked it down to this code (6 years old btw xd):
https://github.com/godotengine/godot/blame/a0943acda1232ee9efd2fae9a6f3138603b95979/editor/editor_properties_array_dict.cpp#L143-L145
But when I remove it, the object changes constantly for some reason:

godot.windows.editor.dev.x86_64_m6lvJkZByK.mp4

There is probably some implementation difference in Dictionary vs Array properties that causes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants