Skip to content
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 @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed an issue where users can't create multiple Boolean or Enum keywords on the blackboard. [1329021](https://issuetracker.unity3d.com/issues/shadergraph-cant-create-multiple-boolean-or-enum-keywords)
- 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/)
- Fixed a ShaderGraph issue where ObjectField focus and Node selections would both capture deletion commands [1313943].
- Fixed a ShaderGraph issue where the right click menu doesn't work when a stack block node is selected [1320212].



Expand Down
10 changes: 9 additions & 1 deletion com.unity.shadergraph/Editor/Drawing/Views/MaterialGraphView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,20 @@ public override List<Port> GetCompatiblePorts(Port startAnchor, NodeAdapter node

internal bool ResetSelectedBlockNodes()
{
bool anyNodesWereReset = false;
var selectedBlocknodes = selection.FindAll(e => e is MaterialNodeView && ((MaterialNodeView)e).node is BlockNode).Cast<MaterialNodeView>().ToArray();
foreach (var mNode in selectedBlocknodes)
{
var bNode = mNode.node as BlockNode;
var context = GetContext(bNode.contextData);

// Check if the node is currently floating (it's parent isn't the context view that owns it).
// If the node's not floating then the block doesn't need to be reset.
bool isFloating = mNode.parent != context;
if (!isFloating)
continue;

anyNodesWereReset = true;
RemoveElement(mNode);
context.InsertBlock(mNode);

Expand All @@ -212,7 +220,7 @@ internal bool ResetSelectedBlockNodes()
}
if (selectedBlocknodes.Length > 0)
graph.ValidateCustomBlockLimit();
return selectedBlocknodes.Length > 0;
return anyNodesWereReset;
}

public override void BuildContextualMenu(ContextualMenuPopulateEvent evt)
Expand Down