Skip to content

Sg/fix quotations in property names #66

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
Apr 27, 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
1 change: 1 addition & 0 deletions com.unity.shadergraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed a compilation error when using Hybrid Renderer due to incorrect positioning of macros.
- Fixed a bug where the `Create Node Menu` lagged on load. Entries are now only generated when property, keyword, or subgraph changes are detected. [1209567](https://issuetracker.unity3d.com/issues/shadergraph-opening-node-search-window-is-unnecessarily-slow).
- 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
- Fixed a bug where the `Position` node would change coordinate spaces from `World` to `Absolute World` when shaders recompile. [1184617](https://issuetracker.unity3d.com/product/unity/issues/guid/1184617/)
- Fixed a bug where instanced shaders wouldn't compile on PS4.
- Optimized loading a large Shader Graph. [1209047](https://issuetracker.unity3d.com/issues/shader-graph-unresponsive-editor-when-using-large-graphs)
Expand Down
4 changes: 2 additions & 2 deletions com.unity.shadergraph/Documentation~/Blackboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
For a full list of Property types, see [Property Types](Property-Types).
2 changes: 2 additions & 0 deletions com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ static void Visit(List<AbstractMaterialNode> outputList, Dictionary<Guid, Abstra
/// </returns>
internal static string SanitizeName(IEnumerable<string> 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;

Expand Down