From 331e7babf3e6b51c401faf1531a7f26fd77992b5 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Wed, 25 Mar 2020 15:39:46 -0500 Subject: [PATCH 1/3] Fix so that properties/keyword display names with a " in them dont break the shadergraph, but get sanitized out --- com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs b/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs index 98456d27766..0ae551510f8 100644 --- a/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs @@ -249,6 +249,8 @@ static void Visit(List outputList, Dictionary internal static string SanitizeName(IEnumerable existingNames, string duplicateFormat, string name) { + //.shader files are not cool with " in the middle of a property name (eg. Vector1_81B203C2("fo"o"o", Float) = 0) + name = name.Replace("\"", "_"); if (!existingNames.Contains(name)) return name; From 04843d5959028d2ee138a047dddeb9f5a070918e Mon Sep 17 00:00:00 2001 From: elizabeth-legros <59933602+elizabeth-legros@users.noreply.github.com> Date: Wed, 25 Mar 2020 15:45:59 -0500 Subject: [PATCH 2/3] Update CHANGELOG.md --- com.unity.shadergraph/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 4fc5e9cafea..a2fe7211b0f 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -85,6 +85,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed a bug where shaders fail to compile due to `#pragma target` generation when your system locale uses commas instead of periods. - Fixed a compilation error when using Hybrid Renderer due to incorrect positioning of macros. - Fixed a bug with the `Transform` node where converting from `Absolute World` space in a sub graph causes invalid subscript errors. [1190813](https://issuetracker.unity3d.com/issues/shadergraph-invalid-subscript-errors-are-thrown-when-connecting-a-subgraph-with-transform-node-with-unlit-master-node) +- Fixed a bug where adding a " to a property display name would cause shader compilation errors and show all nodes as broken ## [7.1.1] - 2019-09-05 ### Added From 7c919302f1183235ab2a14ffcbb92d6897495ec4 Mon Sep 17 00:00:00 2001 From: elizabeth-legros <59933602+elizabeth-legros@users.noreply.github.com> Date: Wed, 25 Mar 2020 16:16:24 -0500 Subject: [PATCH 3/3] Update Blackboard.md Adding note to docs about quotation stripping --- com.unity.shadergraph/Documentation~/Blackboard.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.shadergraph/Documentation~/Blackboard.md b/com.unity.shadergraph/Documentation~/Blackboard.md index 4441b57256f..98d67691cb1 100644 --- a/com.unity.shadergraph/Documentation~/Blackboard.md +++ b/com.unity.shadergraph/Documentation~/Blackboard.md @@ -11,6 +11,6 @@ You can move the Blackboard anywhere in the [Shader Graph Window](Shader-Graph-W To create a new Property or Keyword, click the **Add (+)** button on the Blackboard's title bar, and select a Property or Keyword type. -To reorder items listed on the Blackboard, drag and drop them. To delete items, use the Delete key on Windows, or the Command + Backspace key combination on OS X. To rename an item, double-click on its name, and enter a new name. Drag Properties and Keywords from the Blackboard to the graph to create a corresponding node. +To reorder items listed on the Blackboard, drag and drop them. To delete items, use the Delete key on Windows, or the Command + Backspace key combination on OS X. To rename an item, double-click on its name, and enter a new name (note: quotation marks in display names will get stripped and replaced with underscores). Drag Properties and Keywords from the Blackboard to the graph to create a corresponding node. -For a full list of Property types, see [Property Types](Property-Types). \ No newline at end of file +For a full list of Property types, see [Property Types](Property-Types).