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
4 changes: 2 additions & 2 deletions com.unity.shadergraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

Version Updated
The version number for this package has increased due to a version update of a related graphics package.
### Fixed
- Fixed undo not being recorded properly for setting active master node, graph precision, and node defaults.

## [8.1.0] - 2020-04-21

Expand Down
3 changes: 3 additions & 0 deletions com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,9 @@ public void ReplaceWith(GraphData other)
if (other == null)
throw new ArgumentException("Can only replace with another AbstractMaterialGraph", "other");

concretePrecision = other.concretePrecision;
m_ActiveOutputNodeGuid = other.m_ActiveOutputNodeGuid;

using (var removedInputsPooledObject = ListPool<Guid>.GetDisposable())
{
var removedInputGuids = removedInputsPooledObject.value;
Expand Down
6 changes: 4 additions & 2 deletions com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ public GraphEditorView(EditorWindow editorWindow, GraphData graph, MessageManage

EditorGUI.BeginChangeCheck();
GUILayout.Label("Precision");
graph.concretePrecision = (ConcretePrecision)EditorGUILayout.EnumPopup(graph.concretePrecision, GUILayout.Width(100f));
GUILayout.Space(4);
var precision = (ConcretePrecision)EditorGUILayout.EnumPopup(graph.concretePrecision, GUILayout.Width(100f));
if (EditorGUI.EndChangeCheck())
{
m_Graph.owner.RegisterCompleteObjectUndo("Changed Graph Precision");
graph.concretePrecision = precision;

var nodeList = m_GraphView.Query<MaterialNodeView>().ToList();
m_ColorManager.SetNodesDirty(nodeList);
graph.ValidateGraph();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ public override void BuildContextualMenu(ContextualMenuPopulateEvent evt)

void SetMasterAsActive(DropdownMenuAction action)
{
node.owner.owner.RegisterCompleteObjectUndo("Change Active Master");
node.owner.activeOutputNodeGuid = node.guid;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ void AddField(Vector4 initialValue, int index, string subLabel)
m_Node.Dirty(ModificationScope.Node);
}
});
// Reset UndoGroup when done editing input field
// Reset UndoGroup when done editing input field & update title
field.Q("unity-text-input").RegisterCallback<FocusOutEvent>(evt =>
{
m_UndoGroup = -1;
});
{
m_Node.owner.owner.isDirty = true;
m_UndoGroup = -1;
});
Add(field);
}
}
Expand Down