diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 5f90b112c8e..9092089ed14 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where a requirement was placed on a fixed-function emission property [1319637] - Fixed default shadergraph precision so it matches what is displayed in the graph settings UI (single) [1325934] - Fixed an unhelpful error message when custom function nodes didn't have a valid file [1323493]. +- Fixed a bug where changing a Target setting would switch the inspector view to the Node Settings tab if any nodes were selected. - Fixed "Disconnect All" option being grayed out on stack blocks [1313201]. - Fixed how shadergraph's prompt for "unsaved changes" was handled to fix double messages and incorrect window sizes [1319623]. - Fixed an issue where generated property reference names could conflict with Shader Graph reserved keywords [1328762] (https://issuetracker.unity3d.com/product/unity/issues/guid/1328762/) diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs index 36836b29a67..2cdcbaed896 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs @@ -34,6 +34,8 @@ class InspectorView : GraphSubWindow Label m_MaxItemsMessageLabel; + internal static bool forceNodeView = true; + void RegisterPropertyDrawer(Type newPropertyDrawerType) { if (typeof(IPropertyDrawer).IsAssignableFrom(newPropertyDrawerType) == false) @@ -132,7 +134,7 @@ public void Update() if (m_CurrentlyInspectedElementsCount == k_InspectorElementLimit) m_NodeSettingsContainer.Add(m_MaxItemsMessageLabel); } - if (anySelectables) + if (anySelectables && forceNodeView) { // Anything selectable in the graph (GraphSettings not included) is only ever interacted with through the // Node Settings tab so we can make the assumption they want to see that tab diff --git a/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs b/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs index 5ff98cfff02..faaff10fbe6 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs @@ -111,7 +111,10 @@ void ChangeTargetSettings() graph.UpdateActiveBlocks(activeBlocks); this.m_PreviewManagerUpdateDelegate(); + //Quick bugfix for 1327208. Can be fixed properly with GTF + Inspector.InspectorView.forceNodeView = false; this.m_InspectorUpdateDelegate(); + Inspector.InspectorView.forceNodeView = true; } void ChangePrecision(GraphPrecision newGraphDefaultPrecision)