Skip to content

Commit 74829a2

Browse files
iTris666julienf-unity
authored andcommitted
Call recreateCopy after recusion test not before. #52
1 parent fb978d0 commit 74829a2

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

com.unity.visualeffectgraph/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2626
- Subgraphs are not in hardcoded categories anymore : updated default subgraph templates + Samples to add meaningful categories.
2727
- Enum fields having headers show the header in the inspector as well.
2828
- Fix incorrect propagation on expression flags [Case 1246738](https://issuetracker.unity3d.com/product/unity/issues/guid/1246738/)
29+
- fix crash when creating a loop in subgraph operators [Case 1251523](https://issuetracker.unity3d.com/product/unity/issues/guid/1251523/)
2930

3031
## [7.4.1] - 2020-06-03
3132

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

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

179-
protected override void OnInvalidate(VFXModel model, InvalidationCause cause)
180-
{
181-
if (cause == InvalidationCause.kSettingChanged && (subgraph != null || object.ReferenceEquals(m_Subgraph, null)))
182-
{
183-
RecreateCopy();
184-
}
185-
186-
base.OnInvalidate(model, cause);
187-
}
188-
189179
public VFXModel[] subChildren
190180
{
191181
get { return m_SubChildren; }
@@ -252,11 +242,11 @@ protected internal override void Invalidate(VFXModel model, InvalidationCause ca
252242
if (graph != null && subgraph != null && m_Subgraph.GetResource() != null)
253243
{
254244
var otherGraph = m_Subgraph.GetResource().GetOrCreateGraph();
255-
if (otherGraph != m_UsedSubgraph)
256-
RecreateCopy();
257245
if (otherGraph == graph || otherGraph.subgraphDependencies.Contains(graph.GetResource().visualEffectObject))
258246
m_Subgraph = null; // prevent cyclic dependencies.
259-
if (graph.GetResource().isSubgraph) // BuildSubgraphDependenciesis called for vfx by recompilation, but in subgraph we must call it explicitely
247+
if (otherGraph != m_UsedSubgraph)
248+
RecreateCopy();
249+
if (graph.GetResource().isSubgraph) // BuildSubgraphDependencies is called for vfx by recompilation, but in subgraph we must call it explicitely
260250
graph.BuildSubgraphDependencies();
261251
}
262252
else if (m_UsedSubgraph != null)

com.unity.visualeffectgraph/Editor/Models/Operators/VFXSubgraphOperator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected internal override void Invalidate(VFXModel model, InvalidationCause ca
110110
var otherGraph = m_Subgraph.GetResource().GetOrCreateGraph();
111111
if (otherGraph == graph || otherGraph.subgraphDependencies.Contains(graph.GetResource().visualEffectObject))
112112
m_Subgraph = null; // prevent cyclic dependencies.
113-
if (graph.GetResource().isSubgraph) // BuildSubgraphDependenciesis called for vfx by recompilation, but in subgraph we must call it explicitely
113+
if (graph.GetResource().isSubgraph) // BuildSubgraphDependencies is called for vfx by recompilation, but in subgraph we must call it explicitely
114114
graph.BuildSubgraphDependencies();
115115
}
116116
}

0 commit comments

Comments
 (0)