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

Fix Viewport Texture must be set to use it #97029

Conversation

Hilderin
Copy link
Contributor

This should fix the error "Viewport Texture must be set to use it," which is displayed when loading a scene with a Viewport as a texture.

The issue was that the scene had not been loaded when attempting to set the ViewportTexture to the mesh the first time during scene loading. Checking for vp_changed ensures that the errors occurs only when the ViewPort is not found.

Tested with MRPs from the issue and Godot demo projects:
Procedural Materials
GUI in 3D

@Hilderin Hilderin requested a review from a team as a code owner September 15, 2024 03:37
@Hilderin Hilderin added this to the 4.4 milestone Sep 15, 2024
@Mickeon
Copy link
Contributor

Mickeon commented Sep 17, 2024

The additional condition has me wonder if it's worth to merge both conditions in a single inline function as they're often repeated.

@Hilderin Hilderin force-pushed the fix-viewport-texture-must-be-set-to-use-it branch from a0adc4a to c11107b Compare September 17, 2024 22:18
@Hilderin
Copy link
Contributor Author

I made a separate method to validate and print the error message when the Viewport is on set.

@akien-mga akien-mga added the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Sep 18, 2024
@akien-mga akien-mga merged commit 2a8d30a into godotengine:master Sep 18, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@mdarius31
Copy link

Thank you very much!

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

Successfully merging this pull request may close these issues.

False error "Viewport Texture must be set to use it."
4 participants