Skip to content

Commit ddfa20d

Browse files
arttu-peltonenEvergreen
authored andcommitted
Fix issues when inspecting renderer and volume profile assets under specific circumstances
This PR fixes two issues: https://jira.unity3d.com/browse/UUM-71897 Regression from recent PR https://github.cds.internal.unity3d.com/unity/unity/pull/48923 caused errors to be printed if URP is not the active pipeline when inspecting URP renderer assets. Added a null check. https://jira.unity3d.com/browse/UUM-71890 When opening the editor, it's possible SRP is configured to be used but it has not been activated. In this situation you may see an empty volume inspector. Adding a message to let user know what is happening.
1 parent 2b4fed1 commit ddfa20d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeProfileEditor.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@ void OnDisable()
4343
/// <inheritdoc/>
4444
public override void OnInspectorGUI()
4545
{
46-
if (componentList == null)
46+
if (componentList == null || componentList.asset == null)
4747
{
4848
if (!VolumeManager.instance.isInitialized)
49+
{
50+
EditorGUILayout.HelpBox("Volume Profiles require an active Scriptable Render Pipeline, but nothing has been rendered. Make sure Scene or Game View is in focus and no debug modes are active.", MessageType.Warning);
4951
return; // Defer initialization until VolumeManager is initialized
52+
}
5053

5154
Init();
5255
}

Packages/com.unity.render-pipelines.universal/Editor/UniversalRendererDataEditor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ public override void OnInspectorGUI()
203203

204204

205205
EditorGUI.indentLevel--;
206-
var renderGraphSettings = GraphicsSettings.GetRenderPipelineSettings<RenderGraphSettings>();
207-
if (renderGraphSettings.enableRenderCompatibilityMode)
206+
if (GraphicsSettings.TryGetRenderPipelineSettings<RenderGraphSettings>(out var renderGraphSettings)
207+
&& renderGraphSettings.enableRenderCompatibilityMode)
208208
{
209209
EditorGUILayout.Space();
210210
EditorGUILayout.LabelField(Styles.RenderPassSectionLabel, EditorStyles.boldLabel);

0 commit comments

Comments
 (0)