Skip to content

Commit 19e3fba

Browse files
iTris666julienf-unity
authored andcommitted
Call recreateCopy after recusion test not before. #52
1 parent 361f721 commit 19e3fba

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

com.unity.visualeffectgraph/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
### Fixed
1010
- Fix for node window staying when clicking elsewhere
1111
- Prefab highlight missing for initial event name toggle [Case 1263012](https://issuetracker.unity3d.com/product/unity/issues/guid/1263012/)
12+
- fix crash when creating a loop in subgraph operators [Case 1251523](https://issuetracker.unity3d.com/product/unity/issues/guid/1251523/)
1213

1314
## [8.2.0] - 2020-07-08
1415

com.unity.visualeffectgraph/Editor/Models/Blocks/VFXSubgraphBlock.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,6 @@ public void PatchInputExpressions()
196196
VFXSubgraphUtility.TransferExpressionToParameters(inputExpressions, GetParameters(t => VFXSubgraphUtility.InputPredicate(t)).OrderBy(t => t.order));
197197
}
198198

199-
protected override void OnInvalidate(VFXModel model, InvalidationCause cause)
200-
{
201-
if (cause == InvalidationCause.kSettingChanged && (subgraph != null || object.ReferenceEquals(m_Subgraph, null)))
202-
{
203-
RecreateCopy();
204-
}
205-
206-
base.OnInvalidate(model, cause);
207-
}
208-
209199
public VFXModel[] subChildren
210200
{
211201
get { return m_SubChildren; }
@@ -272,11 +262,11 @@ protected internal override void Invalidate(VFXModel model, InvalidationCause ca
272262
if (graph != null && subgraph != null && m_Subgraph.GetResource() != null)
273263
{
274264
var otherGraph = m_Subgraph.GetResource().GetOrCreateGraph();
275-
if (otherGraph != m_UsedSubgraph)
276-
RecreateCopy();
277265
if (otherGraph == graph || otherGraph.subgraphDependencies.Contains(graph.GetResource().visualEffectObject))
278266
m_Subgraph = null; // prevent cyclic dependencies.
279-
if (graph.GetResource().isSubgraph) // BuildSubgraphDependenciesis called for vfx by recompilation, but in subgraph we must call it explicitely
267+
if (otherGraph != m_UsedSubgraph)
268+
RecreateCopy();
269+
if (graph.GetResource().isSubgraph) // BuildSubgraphDependencies is called for vfx by recompilation, but in subgraph we must call it explicitely
280270
graph.BuildSubgraphDependencies();
281271
}
282272
else if (m_UsedSubgraph != null)

0 commit comments

Comments
 (0)