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

[HDRP][Compositor] Do not allow users to directly reset/edit the compositor .asset file #1499

Merged
merged 5 commits into from Aug 6, 2020

Conversation

pmavridis
Copy link
Contributor

@pmavridis pmavridis commented Aug 4, 2020

Purpose of this PR

https://fogbugz.unity3d.com/f/cases/1265631/
https://fogbugz.unity3d.com/f/cases/1263319/
https://fogbugz.unity3d.com/f/cases/1265647/

The compositor .asset file contains values/settings that are auto-generated from the compositor runtime, and we don't expect/want users to reset this file or manually change the values in it (they should use the compositor UI for that) because it will get out-of-sync with the corresponding shader file.

Therefore this PR makes the .asset file not editable, so the "reset" option and the values in the asset are grayed-out:
image

Note: The compositor .asset files are useful when trying to share composition graphs and settings between two projects and this was the main idea behind their creation.

Also we now make sure that we don't throw any exceptions when the user manually deletes compositor resources from disk
(the compositor .asset or the shader graph file).


Testing status

  • Tested following the repro step in the bug ticket (on a new HDRP template by enabling the compositor). The case does not repro anymore because the compositor .asset file is not editable.
  • Tested on an old HDRP project with the compositor. The previously created .asset file is also not editable.
  • Tested deleting the composition graph file and/or composition .asset while the compositor is running and got the expected behavior.

@pmavridis pmavridis added the HDRP label Aug 4, 2020
@pmavridis pmavridis requested review from sebastienlagarde and a team August 4, 2020 11:25
Copy link
Contributor

@TomasKiniulis TomasKiniulis left a comment

Choose a reason for hiding this comment

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

Works as expected! Seems to work correctly deleting Compositor folder, asset, resetting the asset

@sebastienlagarde sebastienlagarde marked this pull request as ready for review August 6, 2020 08:16
@sebastienlagarde sebastienlagarde merged commit efb4b41 into HDRP/staging Aug 6, 2020
@sebastienlagarde sebastienlagarde deleted the HDRP/case_1265631 branch August 6, 2020 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants