From d842c0a7a7b475831310bb73b81d6026c92890f8 Mon Sep 17 00:00:00 2001 From: Julien Amsellem Date: Thu, 2 Sep 2021 19:02:31 +0200 Subject: [PATCH 1/4] Value comparison was not working because we are comparing objects It was resulting in always recompiling the vfx even if the value had not changed --- com.unity.visualeffectgraph/Editor/Models/VFXModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs b/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs index 7d885e6aee4..b03c66cdf1a 100644 --- a/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs +++ b/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs @@ -327,7 +327,7 @@ private bool SetSettingValueAndReturnIfChanged(string name, object value) } var currentValue = setting.value; - if (currentValue != value) + if (!currentValue.Equals(value)) { setting.field.SetValue(setting.instance, value); OnSettingModified(setting); From 9df7e4e3cb4bfddf4e3f767188513ba56b7a570e Mon Sep 17 00:00:00 2001 From: Julien Amsellem Date: Thu, 2 Sep 2021 19:04:51 +0200 Subject: [PATCH 2/4] Updated changelog --- com.unity.visualeffectgraph/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.visualeffectgraph/CHANGELOG.md b/com.unity.visualeffectgraph/CHANGELOG.md index 9ed08f5929e..0e3ce198183 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -101,6 +101,7 @@ The version number for this package has increased due to a version update of a r - Exposed Parameter placement can be moved after sanitize - 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/) +- Prevent vfx re-compilation in some cases when a value has not changed ## [11.0.0] - 2020-10-21 ### Added From 85140ad39d48bbf1b097db487bac848233da4bb7 Mon Sep 17 00:00:00 2001 From: Julien Amsellem Date: Thu, 9 Sep 2021 16:30:27 +0200 Subject: [PATCH 3/4] NRE could happen if the model's current value is null --- com.unity.visualeffectgraph/Editor/Models/VFXModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs b/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs index b03c66cdf1a..1f5d05ca294 100644 --- a/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs +++ b/com.unity.visualeffectgraph/Editor/Models/VFXModel.cs @@ -327,7 +327,7 @@ private bool SetSettingValueAndReturnIfChanged(string name, object value) } var currentValue = setting.value; - if (!currentValue.Equals(value)) + if (!currentValue?.Equals(value) ?? value != null) { setting.field.SetValue(setting.instance, value); OnSettingModified(setting); From 7543c188115f8f41316a75474a08ecf03efd370f Mon Sep 17 00:00:00 2001 From: Julien Amsellem Date: Mon, 13 Sep 2021 12:13:07 +0200 Subject: [PATCH 4/4] Moved changelog entry from v12 to v13 --- 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 f608b2f8c05..4cf30ced716 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [13.0.0] - 2021-09-01 ### Fixed - Prevent vector truncation error in HDRP Decal template +- Prevent vfx re-compilation in some cases when a value has not changed Version Updated The version number for this package has increased due to a version update of a related graphics package. @@ -106,7 +107,6 @@ The version number for this package has increased due to a version update of a r - Don't open an empty VFX Graph Editor when assigning a VFX Asset to a Visual Effect GameObject from the inspector [Case 1347399](https://issuetracker.unity3d.com/product/unity/issues/guid/1347399/) - Visual Effect inspector input fields don't lose focus anymore while typing (Random seed) - Subgraph output properties tooltips were not easily editable when multiline -- Prevent vfx re-compilation in some cases when a value has not changed ## [11.0.0] - 2020-10-21 ### Added