Skip to content

Commit

Permalink
Fix Event connected directly to Output Event (#152)
Browse files Browse the repository at this point in the history
* Add missing filter in CanLink function

* Add editor test

* *Update changelog.md

* *Update comment

* *Update Comment
  • Loading branch information
PaulDemeulenaere authored and GitHub Enterprise committed Oct 28, 2020
1 parent 182437a commit adaeba7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,24 @@ public void MultiLinkSpawnerSpawnerAfterSpawnerInit()
Assert.AreEqual(2, from.outputContexts.Count());
}


[Test] //see fogbugz 1269756
public void Link_Fail_From_Event_To_OutputEvent()
{
var from = ScriptableObject.CreateInstance<VFXBasicEvent>();
var to = ScriptableObject.CreateInstance<VFXOutputEvent>();
Assert.IsFalse(VFXContext.CanLink(from, to));
}

[Test]
public void Link_Fail_From_Event_To_Initialize()
{
//For now, we can't use direct link from event to initialize context.
var from = ScriptableObject.CreateInstance<VFXBasicEvent>();
var to = ScriptableObject.CreateInstance<VFXBasicInitialize>();
Assert.IsFalse(VFXContext.CanLink(from, to));
}

[Test]
public void Link_Fail()
{
Expand Down
1 change: 1 addition & 0 deletions com.unity.visualeffectgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The version number for this package has increased due to a version update of a r
- Fix [Case 1268354](https://fogbugz.unity3d.com/f/cases/1268354/)
- Fixed rare bug causing the vfx compilation to do nothing silently.
- Fixed vfx compilation when a diffusion profile property is added to a vfx shadergraph
- Forbid incorrect link between incompatible context [Case 1269756](https://issuetracker.unity3d.com/product/unity/issues/guid/1269756/)

## [10.1.0] - 2020-10-12
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ public static bool CanLink(VFXContext from, VFXContext to, int fromIndex = 0, in
if (from.m_ContextType == VFXContextType.SpawnerGPU && to.m_ContextType == VFXContextType.OutputEvent)
return false;

//Can't connect directly event to context (OutputEvent or Initialize) for now
if (from.m_ContextType == VFXContextType.Event && to.contextType != VFXContextType.Spawner)
return false;

return true;
}

Expand Down

0 comments on commit adaeba7

Please sign in to comment.