Skip to content

Commit 8c11291

Browse files
julienamsellemEvergreen
authored andcommitted
[VFX] Fixed wrong node type in CurlNoise variant
Jira: [UUM-72985](https://jira.unity3d.com/browse/UUM-72985) 1. Create project using High Definition 3D Template 2. Create VFX Asset and open it 3. In New VFX window press space or right-click to open VFX Node Search Window 4. In the Search field type “Curl” 5. From the panel double click on “Value Curl Noise 2D” 6. Observe the Console window Actual results: Error “ArgumentException: Object of type 'UnityEditor.VFX.Operator.CurlNoise+DimensionCount' cannot be converted to type 'UnityEditor.VFX.Operator.Noise+DimensionCount’.” Expected results: No errors are thrown in the Console, Node is added to the VFX Workspace Reproducible with versions: 17.0.3 (6000.0.1f1, 6000.0.4f1) Not reproducible with versions: 17.0.3 (6000.0.0f1) Tested on (OS): MacBook Pro, 2021. Sonoma 14.4.1 (M1)
1 parent 96588ba commit 8c11291

File tree

2 files changed

+11
-4
lines changed
  • Packages/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations
  • Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests

2 files changed

+11
-4
lines changed

Packages/com.unity.visualeffectgraph/Editor/Models/Operators/Implementations/CurlNoise.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public override IEnumerable<Variant> GetVariants()
3131
yield return new Variant(
3232
type.ToString().Label().AppendLiteral("Curl Noise").AppendLabel(VFXBlockUtility.GetNameString(dimension)),
3333
category,
34-
typeof(Noise),
34+
typeof(CurlNoise),
3535
new[]
3636
{
3737
new KeyValuePair<string, object>("type", type),

Tests/SRPTests/Projects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/VFXGUITests.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,11 @@ public void ExpandRetractAndSetPropertyValue()
395395
public void CreateAllOperatorsTest()
396396
{
397397
var viewController = VFXTestCommon.StartEditTestAsset();
398-
Assert.DoesNotThrow(() =>CreateAllOperators(viewController));
398+
Assert.DoesNotThrow(() =>
399+
{
400+
var operators = CreateAllOperators(viewController);
401+
Debug.Log($"Created {operators.Length} operators");
402+
});
399403
}
400404

401405
[UnityTest]
@@ -434,6 +438,7 @@ public IEnumerator CollapseTest()
434438
VFXOperator[] CreateAllOperators(VFXViewController viewController)
435439
{
436440
return VFXLibrary.GetOperators()
441+
.SelectMany(x => new [] {x}.Concat(x.subVariantDescriptors))
437442
.Select((x, i) => viewController.AddVFXOperator(new Vector2(700, 150 * i), x.variant))
438443
.ToArray();
439444
}
@@ -1009,14 +1014,16 @@ private static VFXModelDescriptor<VFXBlock>[] GetAllBlocks(bool filterOut, Predi
10091014
{
10101015
return VFXLibrary.GetBlocks()
10111016
.Where(x => predicate(x))
1012-
//.GroupBy(x => x.category)
1013-
//.Select(x => x.First())
1017+
.SelectMany(x => new [] { x }.Concat(x.subVariantDescriptors))
1018+
.Cast<VFXModelDescriptor<VFXBlock>>()
10141019
.ToArray();
10151020
}
10161021
else
10171022
{
10181023
return VFXLibrary.GetBlocks()
10191024
.Where(x => predicate(x))
1025+
.SelectMany(x => new [] { x }.Concat(x.subVariantDescriptors))
1026+
.Cast<VFXModelDescriptor<VFXBlock>>()
10201027
.ToArray();
10211028
}
10221029
}

0 commit comments

Comments
 (0)