Skip to content

Display warning when trying to access HDRP default settings whit no SRP asset set #2204

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 1 commit into from
Oct 13, 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
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public class Styles

public void DoGUI(string searchContext)
{
if (HDRenderPipeline.defaultAsset == null)
{
EditorGUILayout.HelpBox("Base SRP Asset is not a HDRenderPipelineAsset.", MessageType.Warning);
return;
}

m_SerializeHDRPAsset.Update();

m_ScrollViewPosition = GUILayout.BeginScrollView(m_ScrollViewPosition, EditorStyles.largeLabel);
Expand Down Expand Up @@ -98,6 +104,9 @@ public void DoGUI(string searchContext)
/// <param name="rootElement"></param>
public void OnActivate(string searchContext, VisualElement rootElement)
{
if (HDRenderPipeline.defaultAsset == null)
return;

m_ScrollViewPosition = Vector2.zero;
InitializeCustomPostProcessesLists();

Expand Down Expand Up @@ -201,7 +210,7 @@ void Draw_GeneralSettings()
var hdrpAsset = HDRenderPipeline.defaultAsset;
if (hdrpAsset == null)
{
EditorGUILayout.HelpBox("Base SRP Asset is not an HDRenderPipelineAsset.", MessageType.Warning);
EditorGUILayout.HelpBox("Base SRP Asset is not a HDRenderPipelineAsset.", MessageType.Warning);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2788,17 +2788,20 @@ internal void UpdateAreaLightEmissiveMesh(bool fromTimeLine = false)
}

// Update Mesh
switch (areaLightShape)
if (HDRenderPipeline.defaultAsset != null)
{
case AreaLightShape.Tube:
if (m_EmissiveMeshFilter.sharedMesh != HDRenderPipeline.defaultAsset.renderPipelineResources.assets.emissiveCylinderMesh)
m_EmissiveMeshFilter.sharedMesh = HDRenderPipeline.defaultAsset.renderPipelineResources.assets.emissiveCylinderMesh;
break;
case AreaLightShape.Rectangle:
default:
if (m_EmissiveMeshFilter.sharedMesh != HDRenderPipeline.defaultAsset.renderPipelineResources.assets.emissiveQuadMesh)
m_EmissiveMeshFilter.sharedMesh = HDRenderPipeline.defaultAsset.renderPipelineResources.assets.emissiveQuadMesh;
break;
switch (areaLightShape)
{
case AreaLightShape.Tube:
if (m_EmissiveMeshFilter.sharedMesh != HDRenderPipeline.defaultAsset.renderPipelineResources.assets.emissiveCylinderMesh)
m_EmissiveMeshFilter.sharedMesh = HDRenderPipeline.defaultAsset.renderPipelineResources.assets.emissiveCylinderMesh;
break;
case AreaLightShape.Rectangle:
default:
if (m_EmissiveMeshFilter.sharedMesh != HDRenderPipeline.defaultAsset.renderPipelineResources.assets.emissiveQuadMesh)
m_EmissiveMeshFilter.sharedMesh = HDRenderPipeline.defaultAsset.renderPipelineResources.assets.emissiveQuadMesh;
break;
}
}

// Update light area size with clamping
Expand Down