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

Imeadiate usage of a duplicated ViewportTexture result in null acess, despite being instanciated. #101990

Open
PeterMarques opened this issue Jan 24, 2025 · 0 comments

Comments

@PeterMarques
Copy link

PeterMarques commented Jan 24, 2025

Tested versions

4.3.stable

System information

linux

Issue description

This may ocour to any node, and is not tested, as it apeared in this context.

But, when .duplicating a ViewportTexture, one cant acess it imediately.

Despite it showing a reference id:

REF1 <ViewportTexture#-9223372012745915145>
VAR1 2987
REF2 <ViewportTexture#-9223372012309707516>

the error:
"
Attempt to call 'save_png_to_buffer' in base 'null instance' on a null instance
"
is trhown, but there is already the reference "9223372012309707516" being confirmed as instanciated in memory already.

So, what?

Steps to reproduce

This code:


extends Node

func _ready() -> void:
	var aa = get_viewport().get_texture()
	printt("REF1",aa)
	printt("VAR1",aa.get_image().save_png_to_buffer().size())
	var bb = aa.duplicate()
	printt("REF2",bb)
	printt("VAR2",bb.get_image().save_png_to_buffer().size())

Minimal reproduction project (MRP)

Duplicate Bug.zip

@AThousandShips AThousandShips changed the title Imeadiate usage of a duplicated resource result in null acess, despite being instanciated. Imeadiate usage of a duplicated ViewportTexture result in null acess, despite being instanciated. Jan 24, 2025
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

2 participants