diff --git a/com.unity.visualeffectgraph/CHANGELOG.md b/com.unity.visualeffectgraph/CHANGELOG.md index 8a1b6d4738e..79cbf210a1b 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Extract position from a transform is wrong on GPU [Case 1353533](https://issuetracker.unity3d.com/product/unity/issues/guid/1353533/) - Fix rendering artifacts on some mobile devices [Case 1149057](https://issuetracker.unity3d.com/product/unity/issues/guid/1149057/) - Fix compilation failure on OpenGLES [Case 1348666](https://issuetracker.unity3d.com/product/unity/issues/guid/1348666/) +- 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 +- Fix undetermitism in space with LocalToWorld and WorldToLocal operators [Case 1355820](https://issuetracker.unity3d.com/product/unity/issues/guid/1355820/) ## [10.6.0] - 2021-04-29 ### Fixed @@ -56,7 +59,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Deleting a context node and a block while both are selected throws a null ref exception. [Case 315578](https://issuetracker.unity3d.com/product/unity/issues/guid/1315578/) - Fixed shader compilation errors with textures in shader graph [Case 1309219](https://issuetracker.unity3d.com/product/unity/issues/guid/1309219/) - Fixed issue with VFX using incorrect buffer type for strip data - + ## [10.3.1] - 2021-01-26 Version Updated diff --git a/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs b/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs index 614d2573e8b..790916ad8ca 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/VFXViewWindow.cs @@ -278,6 +278,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; diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs index 11e7aec5a0c..1ab7c7c8c7e 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Controller/VFXViewControllerUndo.cs @@ -201,6 +201,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 2dafba0510c..f483253cfa5 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/VFXView.cs @@ -139,7 +139,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); @@ -1441,7 +1441,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/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; } diff --git a/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs b/com.unity.visualeffectgraph/Editor/Models/Parameters/VFXDynamicBuiltInParameter.cs index 074590aff6f..6fbc3079a39 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); diff --git a/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs b/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs index 5b29518e989..9714158b119 100644 --- a/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs +++ b/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs @@ -158,7 +158,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. } }