Add a specific error when creating a ViewportTexture in a Texture2D node #85723
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)