diff --git a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs index 01d4c7c00e2..04b8d919cd0 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs @@ -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 @@ -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(); } } diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 8cf6a8f0b95..f3b7bbeeb88 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -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.