Skip to content

[VFX] Fix Sanitize behavior #4971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
01e8e42
Add regression test on basic sanitize
PaulDemeulenaere Jun 17, 2021
43b4832
Move SanitizeForImport
PaulDemeulenaere Jun 24, 2021
e228f63
*Minor : Missing InvariantCultureIgnoreCase flag in EndsWith
PaulDemeulenaere Jun 24, 2021
4d22c94
*Update changelog.md
PaulDemeulenaere Jun 24, 2021
99ab5fb
*Fix HDRP warning
PaulDemeulenaere Jun 24, 2021
d0d9438
Revert "*Fix HDRP warning"
PaulDemeulenaere Jun 25, 2021
cbfa99c
More conservative way of workaround Preprocess issue
PaulDemeulenaere Jun 27, 2021
508d713
Remove DestroyImmediate
PaulDemeulenaere Jun 30, 2021
1fb0835
Revert "Remove DestroyImmediate "
PaulDemeulenaere Jun 30, 2021
ff51dcf
Add HDRPUserSettings
PaulDemeulenaere Jun 30, 2021
6c5f90b
Revert "Add HDRPUserSettings"
PaulDemeulenaere Jun 30, 2021
a569cbe
Force m_WizardPopupAtStart to false
PaulDemeulenaere Jun 30, 2021
4f90950
Merge branch 'master' into vfx/fix/1344645-sanitize-failure
PaulDemeulenaere Jun 30, 2021
ded88dc
Improvement of this workaround after discussion with @julienf
PaulDemeulenaere Jul 1, 2021
9e94d07
Minor : Editor Test cleanup
PaulDemeulenaere Jul 2, 2021
8d4cdec
Gather all ImportAsset after all Sanitize from the same batch
PaulDemeulenaere Jul 2, 2021
f5a6be5
Minor changes : Change log & Safe execption handling
PaulDemeulenaere Jul 7, 2021
d17ddef
Merge branch 'master' into vfx/fix/1344645-sanitize-failure
PaulDemeulenaere Jul 7, 2021
5e6c3ea
Merge branch 'master' into vfx/fix/1344645-sanitize-failure
PaulDemeulenaere Jul 8, 2021
15059cf
Fix sanitize issue during the very first loading
PaulDemeulenaere Jul 9, 2021
8f944a6
Merge branch 'master' into vfx/fix/1344645-sanitize-failure
PaulDemeulenaere Jul 9, 2021
8c442a8
*Minor* Replace `return` by `continue`
PaulDemeulenaere Jul 12, 2021
2c0bde7
Merge branch 'master' into vfx/fix/1344645-sanitize-failure
PaulDemeulenaere Jul 12, 2021
3aa94cc
Merge branch 'master' into vfx/fix/1344645-sanitize-failure
PaulDemeulenaere Jul 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,31 +93,16 @@ public void CheckDataType()
Assert.IsInstanceOf<VFXDataParticle>(output.GetData());
}

string tempFilePath = "Assets/Temp_vfxTest_Ddata.vfx";

VFXGraph MakeTemporaryGraph()
{
if (System.IO.File.Exists(tempFilePath))
{
AssetDatabase.DeleteAsset(tempFilePath);
}
var asset = VisualEffectAssetEditorUtility.CreateNewAsset(tempFilePath);
VisualEffectResource resource = asset.GetResource(); // force resource creation
VFXGraph graph = ScriptableObject.CreateInstance<VFXGraph>();
graph.visualEffectResource = resource;
return graph;
}

[OneTimeTearDown]
public void CleanUp()
{
AssetDatabase.DeleteAsset(tempFilePath);
VFXTestCommon.DeleteAllTemporaryGraph();
}

[Test]
public void CheckName_Sharing_Between_Output_Event()
{
var graph = MakeTemporaryGraph();
var graph = VFXTestCommon.MakeTemporaryGraph();

var gameObj = new GameObject("CheckData_Sharing_Between_Output_Event");
var vfxComponent = gameObj.AddComponent<VisualEffect>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,38 @@ private VisualEffectAsset CreateAssetAtPath(string path)
return VisualEffectAssetEditorUtility.CreateNewAsset(path);
}

[Test]
public void Sanitize_GetSpawnCount()
{
string kSourceAsset = "Assets/AllTests/Editor/Tests/VFXSerializationTests_GetSpawnCount.vfx_";
var graph = VFXTestCommon.CopyTemporaryGraph(kSourceAsset);

Assert.AreEqual(5, graph.children.OfType<VFXAttributeParameter>().Count());
Assert.AreEqual(5, graph.children.OfType<VFXInlineOperator>().Where(o => o.type == typeof(uint)).Count());
Assert.AreEqual(1, graph.children.OfType<VFXInlineOperator>().Where(o => o.type == typeof(float)).Count());
Assert.AreEqual(1, graph.children.OfType<Operator.Add>().Count());
Assert.AreEqual(1, graph.children.OfType<VFXInlineOperator>().Where(o => o.type == typeof(Color)).Count());

foreach (var attribute in graph.children.OfType<VFXAttributeParameter>())
Assert.IsTrue(attribute.outputSlots[0].HasLink());

foreach (var inlineUInt in graph.children.OfType<VFXInlineOperator>().Where(o => o.type == typeof(uint)))
Assert.IsTrue(inlineUInt.inputSlots[0].HasLink());

foreach (var inlineFloat in graph.children.OfType<VFXInlineOperator>().Where(o => o.type == typeof(float)))
Assert.IsTrue(inlineFloat.inputSlots[0].HasLink());

foreach (var inlineColor in graph.children.OfType<VFXInlineOperator>().Where(o => o.type == typeof(Color)))
Assert.IsTrue(inlineColor.inputSlots[0].HasLink());

foreach (var add in graph.children.OfType<Operator.Add>())
{
Assert.AreEqual(2, add.operandCount);
Assert.IsTrue(add.inputSlots[0].HasLink());
Assert.IsTrue(add.inputSlots[1].HasLink());
}
}

[OneTimeSetUpAttribute]
public void OneTimeSetUpAttribute()
{
Expand Down
Loading