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

Stop ViewportTexture error spam #37038

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Phischermen
Copy link
Contributor

The viewport path property in ViewportTexture can sometimes be invalid due to the viewport not yet being initialized. This causes an error, but the texture will still work. Thus, texture is now refreshed via call_deffered(), ensuring the viewport is initialized before refreshing the texture.

Fixes #27790

@Phischermen Phischermen force-pushed the viewport-path-invalid branch from e1f3c13 to 46bd01e Compare March 14, 2020 06:37
@Phischermen Phischermen changed the title Fix ViewportTexture error spam Stop ViewportTexture error spam Mar 14, 2020
@Chaosus Chaosus added bug topic:core cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Mar 14, 2020
@Chaosus Chaosus added this to the 4.0 milestone Mar 14, 2020
@Phischermen
Copy link
Contributor Author

Travis says I didn't pass a static check. Is there something wrong with the format of my code? My commit?

@clayjohn
Copy link
Member

Looks like extra whitespace after "call_deferred"

@Phischermen Phischermen force-pushed the viewport-path-invalid branch from 46bd01e to abdc82d Compare March 15, 2020 19:58
@akien-mga akien-mga requested a review from reduz April 16, 2020 10:37
drwhut added a commit to drwhut/godot that referenced this pull request Jun 6, 2021
This commit is based on the PR godotengine#37038.
@tengkuizdihar
Copy link

tengkuizdihar commented Apr 2, 2022

Would there be an update for this one? I'm having issues when trying to make my own Label3D where the viewport always does this.

@Calinou
Copy link
Member

Calinou commented Apr 2, 2022

Would there be an update for this one? I'm having issues when trying to make my own Label3D where the viewport always does this.

I would recommend testing the pull request and making sure it fixes the issue as described without introducing regressions on its own.

Note that this pull request targets master, not 3.x. The fix in 3.x is most likely identical, so you can cherry-pick the commit or apply the change manually on top of the 3.x branch and recompile the editor.

@tengkuizdihar
Copy link

tengkuizdihar commented Apr 3, 2022

I've done it last night and patched it myself against 3.4.2, it still doesn't work. The error messages still pops up.

CC: @Calinou

@Phischermen
Copy link
Contributor Author

@tengkuizdihar Dang! Could you upload your project so I could debug my pull request?

@Calinou
Copy link
Member

Calinou commented May 4, 2022

@tengkuizdihar Bump 🙂 See Phischerman's comment above.

@YuriSizov YuriSizov modified the milestones: 4.0, 4.x Feb 12, 2023
@akien-mga
Copy link
Member

Related to #64388, CC @Rindbee for cross review.

@tengkuizdihar
Copy link

Oh my god I'm sorry, it has been a year I have no idea how to replicate this issue anymore
I don't even think I have encountered this issue anymore...

@Rindbee
Copy link
Contributor

Rindbee commented Feb 24, 2023

Probably due to modifications elsewhere, the effect of this commit is not apparent.

In #64388, this code is for the case where the node using the ViewportTexture is instantiated before the target Viewport when running the scene.

There are some differences between opening the scene in the editor and running a scene. ViewportTexture::set_viewport_path_in_scene() is called once when opening the scene in the editor, but twice when running the scene.

@Rindbee
Copy link
Contributor

Rindbee commented Feb 24, 2023

This PR seems to address issues with the order of enter_tree when running scenes. But another issue was exposed.

RC3 This PR
RC3 This

test.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:3.x Considered for cherry-picking into a future 3.x release needs testing topic:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ViewportTexture: Path to node is invalid
8 participants