Skip to content

Commit adaeba7

Browse files
PaulDemeulenaereGitHub Enterprise
authored andcommitted
Fix Event connected directly to Output Event (#152)
* Add missing filter in CanLink function * Add editor test * *Update changelog.md * *Update comment * *Update Comment
1 parent 182437a commit adaeba7

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/VFXContextTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,24 @@ public void MultiLinkSpawnerSpawnerAfterSpawnerInit()
194194
Assert.AreEqual(2, from.outputContexts.Count());
195195
}
196196

197+
198+
[Test] //see fogbugz 1269756
199+
public void Link_Fail_From_Event_To_OutputEvent()
200+
{
201+
var from = ScriptableObject.CreateInstance<VFXBasicEvent>();
202+
var to = ScriptableObject.CreateInstance<VFXOutputEvent>();
203+
Assert.IsFalse(VFXContext.CanLink(from, to));
204+
}
205+
206+
[Test]
207+
public void Link_Fail_From_Event_To_Initialize()
208+
{
209+
//For now, we can't use direct link from event to initialize context.
210+
var from = ScriptableObject.CreateInstance<VFXBasicEvent>();
211+
var to = ScriptableObject.CreateInstance<VFXBasicInitialize>();
212+
Assert.IsFalse(VFXContext.CanLink(from, to));
213+
}
214+
197215
[Test]
198216
public void Link_Fail()
199217
{

com.unity.visualeffectgraph/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ The version number for this package has increased due to a version update of a r
4949
- Fix [Case 1268354](https://fogbugz.unity3d.com/f/cases/1268354/)
5050
- Fixed rare bug causing the vfx compilation to do nothing silently.
5151
- Fixed vfx compilation when a diffusion profile property is added to a vfx shadergraph
52+
- Forbid incorrect link between incompatible context [Case 1269756](https://issuetracker.unity3d.com/product/unity/issues/guid/1269756/)
5253

5354
## [10.1.0] - 2020-10-12
5455
### Added

com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ public static bool CanLink(VFXContext from, VFXContext to, int fromIndex = 0, in
245245
if (from.m_ContextType == VFXContextType.SpawnerGPU && to.m_ContextType == VFXContextType.OutputEvent)
246246
return false;
247247

248+
//Can't connect directly event to context (OutputEvent or Initialize) for now
249+
if (from.m_ContextType == VFXContextType.Event && to.contextType != VFXContextType.Spawner)
250+
return false;
251+
248252
return true;
249253
}
250254

0 commit comments

Comments
 (0)