Fix ScreenShots feature #573
Merged
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.
Problem:
No matter the selected operator
GetCurrentTexture()
is never null so the Screenshot button is always visible.While in Debug mode, clicking the Screenshot button was creating a Screenshot folder in Editor\bin\Debug\net9.0-windows
If a Command or a Texture2D operator is selected we get a png file with the content of the Output View.
If an other kinf of operator is selected we get a png file with the last render (from a Command or Texture2D) of the Output View.
Solution:
Same logic as for the "Start Render" button in the Render To File window
But here we allow to save screenshots for Texture2D and Command operators.
If it doesn't exist a Screenshots folder is created in the opened project's folder and the png image is written inside.
I also added the Screenshots folder to the list of excluded directories in AutoBackup.cs