Skip to content

Fixed an exception thrown when closing the lookdev because there is no active SRP anymore. #1925

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

Merged
merged 3 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,19 @@ IStyle GetEnvironmentContenairDraggerStyle()
}
}

void Update()
{
// [case 1245086] Guard in case the SRP asset is set to null (or to a not supported SRP) when the lookdev window is already open
// Note: After an editor reload, we might get a null OnUpdateRequestedInternal and null SRP for a couple of frames, hence the check.
if (!LookDev.supported && OnUpdateRequestedInternal != null)
{
// Print an error and close the Lookdev window (to avoid spamming the console)
Debug.LogError($"LookDev is not supported by this Scriptable Render Pipeline: "
+ (RenderPipelineManager.currentPipeline == null ? "No SRP in use" : RenderPipelineManager.currentPipeline.ToString()));
LookDev.Close();
}
}

void OnGUI()
{
//Stylesheet
Expand Down Expand Up @@ -690,17 +703,6 @@ void OnGUI()
rootVisualElement.styleSheets.Add(styleSheetLight);
}

// [case 1245086] Guard in case the SRP asset is set to null (or to a not supported SRP) when the lookdev window is already open
// Note: After an editor reload, we might get a null OnUpdateRequestedInternal and null SRP for a couple of frames, hence the check.
if (!LookDev.supported && OnUpdateRequestedInternal !=null)
{
// Print an error and close the Lookdev window (to avoid spamming the console)
Debug.LogError($"LookDev is not supported by this Scriptable Render Pipeline: "
+ (RenderPipelineManager.currentPipeline == null ? "No SRP in use" : RenderPipelineManager.currentPipeline.ToString()));
LookDev.Close();
return;
}

OnUpdateRequestedInternal?.Invoke();
}
}
Expand Down
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed serialization issue with matcap scale intensity.
- Close Add Override popup of Volume Inspector when the popup looses focus (case 1258571)
- Light quality setting for contact shadow set to on for High quality by default.
- Fixed an exception thrown when closing the look dev because there is no active SRP anymore.

### Changed
- Preparation pass for RTSSShadows to be supported by render graph.
Expand Down