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

Errors when instancing a sprite that contains a viewport #34126

Open
jabcross opened this issue Dec 5, 2019 · 4 comments
Open

Errors when instancing a sprite that contains a viewport #34126

jabcross opened this issue Dec 5, 2019 · 4 comments

Comments

@jabcross
Copy link
Contributor

jabcross commented Dec 5, 2019

Godot version: commit 9002b04 (Godot 3.2 beta)

OS/device including version: Linux Mint 19

Issue description:

Instancing a Sprite3D with a ViewportTexture that points to a viewport which descends from it generates many errors and doesn't render correctly.

image

image

Minimal reproduction project:

viewport_wierdness.zip

@jabcross
Copy link
Contributor Author

jabcross commented Dec 5, 2019

Making it so the viewport doesn't descend from the sprite only prevents some of the errors, and now it renders correctly. The error messages are still annoying, tho.

image

Interestingly, changing the order of the nodes changes the number of errors too.

image

@jabcross
Copy link
Contributor Author

jabcross commented Dec 5, 2019

On further inspection, I attempt to assign the ViewportTexture through GDScript.

The highlighted line doesn't seem to execute; after that, the Sprite3D's texture is still [empty] in the remote inspector.

image

@jabcross
Copy link
Contributor Author

jabcross commented Dec 5, 2019

Found a workaround: setting the texture from code using Viewport::get_texture() seems to work. However, I think that the other way I tried to do it should have worked as well.

Also, doing this on ready prevents it from rendering in the editor.

Seems like changing the viewport path dynamically doesn't update the vp pointer in ViewportTexture.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 18, 2020

Still valid in a3a3b02
I re-assigned the viewport path and it reduced error count from 7 to 4. The viewport texture displays correctly despite the error.

EDIT:
On another test, seems like this error only appears on saving. I remember some issue where scene is fake-instanced upon save, which might lead to errors. This is probably the case here.

Issue is still fully valid in 3.2.4 beta3 though.

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