From 9badd197c104adea8f9f9811acda3e152c635813 Mon Sep 17 00:00:00 2001 From: jfryer_unity Date: Tue, 17 Aug 2021 14:20:27 +0200 Subject: [PATCH 1/6] Fix edit only compilation mode --- com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs index d1f8e840111..f011ff21351 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs @@ -137,7 +137,7 @@ Controller IControlledElement.controller void DisconnectController() { if (controller.model && controller.graph) - controller.graph.SetCompilationMode(VFXCompilationMode.Runtime); + controller.graph.SetCompilationMode(VFXViewPreference.forceEditionCompilation ? VFXCompilationMode.Edition : VFXCompilationMode.Runtime); m_Controller.UnregisterHandler(this); From e178478ceacedf14ff1858489c9a736f372b21bf Mon Sep 17 00:00:00 2001 From: jfryer_unity Date: Tue, 17 Aug 2021 14:57:36 +0200 Subject: [PATCH 2/6] Fix infinite compile (case 1346576) --- com.unity.visualeffectgraph/CHANGELOG.md | 1 + com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/com.unity.visualeffectgraph/CHANGELOG.md b/com.unity.visualeffectgraph/CHANGELOG.md index 07f1bef3ce2..7285aaddff0 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -78,6 +78,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Inspector group headers now have a better indentation and alignment - Zoom and warning icons were blurry in the "Play Controls" and "Visual Effect Model" scene overlays - Random crash using subgraph [Case 1345426](https://issuetracker.unity3d.com/product/unity/issues/guid/1345426/) +- Fix potential infinite compilation when using subgraphs [Case 1346576](https://issuetracker.unity3d.com/product/unity/issues/guid/1346576/) ## [11.0.0] - 2020-10-21 ### Added diff --git a/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs b/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs index 7c095b43268..e403d51f648 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs @@ -281,6 +281,7 @@ void Update() { VFXGraph.compileReporter = reporter; AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(graphView.controller.model)); + graph.SetExpressionGraphDirty(false); // As are implemented subgraph now, compiling dependents chain can reset dirty flag on used subgraphs, which will make an infinite loop, this is bad! VFXGraph.compileReporter = null; } VFXGraph.explicitCompile = false; From c0dd817c2f3d74a5263d0c446eee9d220fe82988 Mon Sep 17 00:00:00 2001 From: jfryer_unity Date: Tue, 17 Aug 2021 15:00:08 +0200 Subject: [PATCH 3/6] Fix dirty on undo/redo + add guards to prevent out of sync serializarion (case 1327805) --- com.unity.visualeffectgraph/CHANGELOG.md | 1 + .../Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs | 1 + com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs | 3 +++ com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/CHANGELOG.md b/com.unity.visualeffectgraph/CHANGELOG.md index 7285aaddff0..d6b3283823e 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -79,6 +79,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Zoom and warning icons were blurry in the "Play Controls" and "Visual Effect Model" scene overlays - Random crash using subgraph [Case 1345426](https://issuetracker.unity3d.com/product/unity/issues/guid/1345426/) - Fix potential infinite compilation when using subgraphs [Case 1346576](https://issuetracker.unity3d.com/product/unity/issues/guid/1346576/) +- Prevent out of sync serialization of VFX assets that could cause the asset to be dirtied without reason [Case 1327805](https://issuetracker.unity3d.com/product/unity/issues/guid/1327805/) ## [11.0.0] - 2020-10-21 ### Added diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs index c55cf7c2e28..616f2d41c21 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs @@ -203,6 +203,7 @@ private void SynchronizeUndoRedoState() m_reentrant = true; ExpressionGraphDirty = true; model.GetOrCreateGraph().UpdateSubAssets(); + EditorUtility.SetDirty(graph); NotifyUpdate(); m_reentrant = false; m_graphUndoStack.CleanDirtyState(); diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs index f011ff21351..d2c63cdfd7b 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs @@ -1449,7 +1449,10 @@ void OnSave() foreach (var graph in graphToSave) { if (EditorUtility.IsDirty(graph) || UnityEngine.Object.ReferenceEquals(graph, controller.graph)) + { + graph.UpdateSubAssets(); graph.GetResource().WriteAsset(); + } } } diff --git a/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs b/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs index 1bf1d8ca7e5..6198ee6a05e 100644 --- a/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs +++ b/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs @@ -264,7 +264,7 @@ static string[] OnWillSaveAssets(string[] paths) var vfxResource = VisualEffectResource.GetResourceAtPath(path); if (vfxResource != null) { - var graph = vfxResource.GetOrCreateGraph(); + vfxResource.GetOrCreateGraph().UpdateSubAssets(); vfxResource.WriteAsset(); // write asset as the AssetDatabase won't do it. } } From 856de5e7a966fa509fcd55fc1d21256a82a67034 Mon Sep 17 00:00:00 2001 From: jfryer_unity Date: Tue, 17 Aug 2021 16:59:20 +0200 Subject: [PATCH 4/6] Fix undertiminism with LocaToWorld and WorldToLocal (case 1355820) --- com.unity.visualeffectgraph/CHANGELOG.md | 1 + .../Models/Parameters/VFXDynamicBuiltInParameter.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/com.unity.visualeffectgraph/CHANGELOG.md b/com.unity.visualeffectgraph/CHANGELOG.md index d6b3283823e..a21cb62e4f8 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Random crash using subgraph [Case 1345426](https://issuetracker.unity3d.com/product/unity/issues/guid/1345426/) - Fix potential infinite compilation when using subgraphs [Case 1346576](https://issuetracker.unity3d.com/product/unity/issues/guid/1346576/) - Prevent out of sync serialization of VFX assets that could cause the asset to be dirtied without reason [Case 1327805](https://issuetracker.unity3d.com/product/unity/issues/guid/1327805/) +- Fix undetermitism in space with LocalToWorld and WorldToLocal operators [Case 1355820](https://issuetracker.unity3d.com/product/unity/issues/guid/1355820/) ## [11.0.0] - 2020-10-21 ### Added diff --git a/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs b/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs index 4a7b183d908..639dbc15548 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs @@ -179,6 +179,19 @@ override public string name } } + public override VFXCoordinateSpace GetOutputSpaceFromSlot(VFXSlot outputSlot) + { + switch (m_BuiltInParameters) + { + case BuiltInFlag.LocalToWorld: + return VFXCoordinateSpace.Local; + case BuiltInFlag.WorldToLocal: + return VFXCoordinateSpace.World; + default: + return (VFXCoordinateSpace)int.MaxValue; + } + } + protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpression) { var expressions = builtInParameterEnumerable.Select(b => s_BuiltInInfo[b].expression); From 958c72a4edb4ce18a803a8d48b2b4296660fdf54 Mon Sep 17 00:00:00 2001 From: jfryer_unity Date: Wed, 18 Aug 2021 18:19:10 +0200 Subject: [PATCH 5/6] Fix dirty + determinism issue with operators --- .../Editor/Models/Operators/VFXOperator.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/com.unity.visualeffectgraph/Editor/Models/Operators/VFXOperator.cs b/com.unity.visualeffectgraph/Editor/Models/Operators/VFXOperator.cs index ce58c9d1f54..0165126e0a8 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Operators/VFXOperator.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Operators/VFXOperator.cs @@ -103,6 +103,9 @@ public override VFXCoordinateSpace GetOutputSpaceFromSlot(VFXSlot outputSlot) } } } + if (space == (VFXCoordinateSpace)int.MaxValue) + space = outputSlot.space; + return space; } From 43439eb7947ef8e00c6983b8e929036ff51dedcb Mon Sep 17 00:00:00 2001 From: jfryer_unity Date: Wed, 18 Aug 2021 18:19:36 +0200 Subject: [PATCH 6/6] Remove private bug referenced from changelog --- com.unity.visualeffectgraph/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/CHANGELOG.md b/com.unity.visualeffectgraph/CHANGELOG.md index a21cb62e4f8..9c69afd6a2d 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -79,7 +79,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Zoom and warning icons were blurry in the "Play Controls" and "Visual Effect Model" scene overlays - Random crash using subgraph [Case 1345426](https://issuetracker.unity3d.com/product/unity/issues/guid/1345426/) - Fix potential infinite compilation when using subgraphs [Case 1346576](https://issuetracker.unity3d.com/product/unity/issues/guid/1346576/) -- Prevent out of sync serialization of VFX assets that could cause the asset to be dirtied without reason [Case 1327805](https://issuetracker.unity3d.com/product/unity/issues/guid/1327805/) +- Prevent out of sync serialization of VFX assets that could cause the asset to be dirtied without reason - Fix undetermitism in space with LocalToWorld and WorldToLocal operators [Case 1355820](https://issuetracker.unity3d.com/product/unity/issues/guid/1355820/) ## [11.0.0] - 2020-10-21