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

Add a specific error when creating a ViewportTexture in a Texture2D node #85723

Conversation

ilyabelow
Copy link
Contributor

Now, the "Can't create a ViewportTexture on this resource because it's not set as local to scene" error message is shown when you try to set a ViewportTexture as a texture in a Texture2D node in Visual shader

This error message is wrong - the user should not create such a texture because it would be saved to a file, which would not work and is already forbidden (and also because nodes are resources themselves which are not possible to set as local to scene, as discussed in the corresponding issue #84609)

In the PR I've added a check on parent resource type and a verbose error message which tells the user what the correct way to add a ViewportTexture is (with a Texture2DParameter node)

editor/editor_properties.cpp Outdated Show resolved Hide resolved
@Chaosus Chaosus added this to the 4.3 milestone Dec 4, 2023
@ilyabelow ilyabelow force-pushed the 84609-visual-shader-viewport-texture-error branch from 1800c6d to 9873b43 Compare December 4, 2023 08:50
@ilyabelow ilyabelow force-pushed the 84609-visual-shader-viewport-texture-error branch from 9873b43 to 835d87d Compare December 4, 2023 11:15
@ilyabelow ilyabelow force-pushed the 84609-visual-shader-viewport-texture-error branch from 835d87d to 429f24e Compare December 4, 2023 11:16
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected.

Before

Screenshot_20231206_230848

After

Screenshot_20231206_230814

@YuriSizov YuriSizov merged commit 7fbaefd into godotengine:master Dec 8, 2023
@YuriSizov
Copy link
Contributor

Thanks! And congrats on your first merged contribution to the engine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants