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

Debugger show large variable as [null] when getting Image from Viewport texture (the reference still works) #36801

Closed
bitsycore opened this issue Mar 4, 2020 · 2 comments

Comments

@bitsycore
Copy link
Contributor

bitsycore commented Mar 4, 2020

Godot version:
Issue in 3.2 and and 3.2.rc1
No issue in 3.1.2

OS/device including version:
Tested on Windows on two computer but the bug doesn't appear in 3.1.2 so I didn't tried in another OS because I assumed it's not a OS related issue

Issue description:
When I get the image from the texture of an instanced Viewport the resulting image (duplicate() or not) appear [null] in the debugger but print() actually print it's ID and the use of this var work.

Even other var appeared to be [null] in the debugger but the only problem I isolated was the viewport one. (I'll link a project with the viewport bug)

Steps to reproduce:
get_texture().get_data() from a Viewport inside your scene and assign it in a var

Minimal reproduction project:
Isolated Viewport
Bug-null-ref-debugger.zip

image

Another little project with this issue but when I was writing that issue and changing project multiple time with the minimal it work now (but the minimal still bug)

https://github.com/Coldragon/godot-voronoi-shader-generator

image
image

The bug is inconsistent for me now exept for the minimal project, it's really weird

edit : you can see the conversation I got with another user from the Discord
https://discordapp.com/channels/212250894228652034/477544613511692358/684839269033967639

@bitsycore bitsycore changed the title Debugger show var as [null] when print() and use work Debugger show var as [null] when getting Image from Viewport texture (The reff still work) Mar 4, 2020
@baptr
Copy link
Contributor

baptr commented Mar 1, 2023

I updated the original MRP to work at HEAD and confirm this matches #74148:

Fresh MRP: 36801.zip

With:

@onready var viewport = $SubViewport

func _ready():
	var tex = viewport.get_texture()
	print(tex)
	var img = tex.get_image()
	print(img)
	var dims = img.get_size()
	print(dims)
	var size = img.get_data().size()
	print(size)
	pass # break here

Locally I get:
image

Output:

<ViewportTexture#-9223372010313219669>
<Image#-9223372010229333471>
(1024, 1024)
3145728

Debugger errors:

W 0:00:00:0738   Node2D.gd:14 @ _ready(): Variable img too large to serialize for debugger: 3145964 > 1048576
  <C++ Source>   core/debugger/debugger_marshalls.cpp:83 @ serialize()
  <Stack Trace>  Node2D.gd:14 @ _ready()

@Calinou
Copy link
Member

Calinou commented Feb 1, 2024

Closing in favor of #39465, as this is due to the same cause.

@Calinou Calinou closed this as completed Feb 1, 2024
@Calinou Calinou added archived and removed confirmed labels Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants