Skip to content

[Backport 8.x.x] Fixed Look Dev with Light Theme #1106

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
Jul 7, 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
26 changes: 14 additions & 12 deletions com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface IViewDisplayer
/// <summary>Callback on update requested</summary>
event Action OnUpdateRequested;
}

partial class DisplayWindow : EditorWindow, IViewDisplayer
{
static partial class Style
Expand Down Expand Up @@ -82,7 +82,7 @@ internal static readonly (Texture2D icon, string tooltip) k_LayoutStackIcon =
internal const string k_CameraMenuSync1On2 = "Align Camera 1 with Camera 2";
internal const string k_CameraMenuSync2On1 = "Align Camera 2 with Camera 1";
internal const string k_CameraMenuReset = "Reset Cameras";

internal const string k_EnvironmentSidePanelName = "Environment";
internal const string k_DebugSidePanelName = "Debug";

Expand Down Expand Up @@ -127,7 +127,7 @@ internal static readonly (Texture2D icon, string tooltip) k_LayoutStackIcon =
Label m_NoEnvironment2;

Image[] m_Views = new Image[2];

LayoutContext layout
=> LookDev.currentContext.layout;

Expand All @@ -143,7 +143,7 @@ Layout viewLayout
}
}
}

SidePanel sidePanel
{
get => layout.showedSidePanel;
Expand Down Expand Up @@ -218,7 +218,7 @@ event Action IViewDisplayer.OnUpdateRequested

void OnEnable()
{
//Stylesheet
//Stylesheet
// Try to load stylesheet. Timing can be odd while upgrading packages (case 1219692).
// In this case, it will be fixed in OnGUI. Though it can spawn error while reimporting assets.
// Waiting for filter on stylesheet (case 1228706) to remove last error.
Expand Down Expand Up @@ -486,7 +486,7 @@ Rect IViewDisplayer.GetRect(ViewCompositionIndex index)
throw new ArgumentException("Unknown ViewCompositionIndex: " + index);
}
}

Vector2 m_LastFirstViewSize = new Vector2();
Vector2 m_LastSecondViewSize = new Vector2();
void IViewDisplayer.SetTexture(ViewCompositionIndex index, Texture texture)
Expand Down Expand Up @@ -532,7 +532,7 @@ void IViewDisplayer.SetTexture(ViewCompositionIndex index, Texture texture)
throw new ArgumentException("Unknown ViewCompositionIndex: " + index);
}
}

void IViewDisplayer.Repaint() => Repaint();

void ApplyLayout(Layout value)
Expand Down Expand Up @@ -627,19 +627,21 @@ IStyle GetEnvironmentContenairDraggerStyle()

void OnGUI()
{
//Stylesheet
//Stylesheet
// [case 1219692] if LookDev is open while reimporting CoreRP package,
// stylesheet can be null. In this case, we can have a null stylesheet
// registered as it got destroyed. Reloading it. As we cannot just
// registered as it got destroyed. Reloading it. As we cannot just
// remove a null entry, we must filter and reconstruct the while list.
if (styleSheet == null || styleSheet.Equals(null)
|| (!EditorGUIUtility.isProSkin && (styleSheetLight == null || styleSheetLight.Equals(null))))
{
// While (case 1228706) is still on going, we sill close and reopen the look dev.
// This will prevent spawning error at frame.
LookDev.Close();
LookDev.Open();
return;
// Note 2: This actually causes the lookdev to break completely with light theme.
// Until the actual issue is fixed, we'll comment this fix out as it only concerns an upgrade problem.
//LookDev.Close();
//LookDev.Open();
//return;

// Following lines is the correct fix if UIElement filter garbage collected Stylesheet.

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 @@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix inconsistencies with transparent motion vectors and opaque by allowing camera only transparent motion vectors.
- Fixed issue with depth pyramid generation and dynamic resolution.
- Fixed a serialization issue, preventing quality level parameters to undo/redo and update scene view on change.
- Fixed an issue where opening the look dev window with the light theme would make the window blink and eventually crash unity.

### Changed
- Shadowmask and realtime reflection probe property are hide in Quality settings
Expand Down