Skip to content

Fixed an issue when trying to open a look dev env library when Look Dev is not supported. #2929

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 4 commits into from
Dec 17, 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 @@ -4,6 +4,7 @@
using System.Collections.Generic;
using UnityEngine.UIElements;
using System.IO;
using UnityEditor;
using UnityEditor.UIElements;

namespace UnityEditor.Rendering.LookDev
Expand Down Expand Up @@ -117,26 +118,38 @@ public int IndexOf(Environment environment)
[CustomEditor(typeof(EnvironmentLibrary))]
class EnvironmentLibraryEditor : Editor
{
VisualElement root;
VisualElement m_Root;
VisualElement m_OpenButton;

public sealed override VisualElement CreateInspectorGUI()
{
var library = target as EnvironmentLibrary;
root = new VisualElement();
m_Root = new VisualElement();

Button open = new Button(() =>
m_OpenButton = new Button(() =>
{
if (!LookDev.open)
LookDev.Open();
LookDev.currentContext.UpdateEnvironmentLibrary(library);
LookDev.currentEnvironmentDisplayer.Repaint();
})
{
text = "Open in LookDev window"
text = "Open in Look Dev window"
};
m_OpenButton.SetEnabled(LookDev.supported);

root.Add(open);
return root;
m_Root.Add(m_OpenButton);
return m_Root;
}

void OnEnable() => EditorApplication.update += Update;
void OnDisable() => EditorApplication.update -= Update;

void Update()
{
// Current SRP can be changed at any time so we need to do this at every update.
if (m_OpenButton != null)
m_OpenButton.SetEnabled(LookDev.supported);
}

// Don't use ImGUI
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 @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed ShaderGraph stack blocks appearing when opening the settings in Hair and Eye ShaderGraphs.
- Fixed white screen when undoing in the editor.
- Fixed display of LOD Bias and maximum level in frame settings when using Quality Levels
- Fixed an issue when trying to open a look dev env library when Look Dev is not supported.

### Changed
- Removed the material pass probe volumes evaluation mode.
Expand Down