diff --git a/Source/Editor/Surface/Archetypes/Parameters.cs b/Source/Editor/Surface/Archetypes/Parameters.cs index 3d74d2e10..3383e7662 100644 --- a/Source/Editor/Surface/Archetypes/Parameters.cs +++ b/Source/Editor/Surface/Archetypes/Parameters.cs @@ -1100,6 +1100,27 @@ namespace FlaxEditor.Surface.Archetypes NodeElementArchetype.Factory.ComboBox(2 + 20, 0, 116) } }, + new NodeArchetype + { + TypeID = 5, + Create = (id, context, arch, groupArch) => new SurfaceNodeParamsSet(id, context, arch, groupArch), + Title = "Set Parameter", + Description = "Parameter value setter invoked when the animation pose is evaluated (output pose comes from input)", + Flags = NodeFlags.AnimGraph, + Size = new Float2(140, 40), + DefaultValues = new object[] + { + Guid.Empty, + null + }, + Elements = new[] + { + NodeElementArchetype.Factory.Output(0, string.Empty, typeof(void), 0), + NodeElementArchetype.Factory.Input(0, string.Empty, true, typeof(void), 2), + NodeElementArchetype.Factory.Input(1, string.Empty, true, ScriptType.Null, 1, 1), + NodeElementArchetype.Factory.ComboBox(2 + 20, 0, 116) + } + }, }; } } diff --git a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp index 1e4444af0..08767728a 100644 --- a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp +++ b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp @@ -958,6 +958,21 @@ void AnimGraphExecutor::ProcessGroupParameters(Box* box, Node* node, Value& valu } break; } + // Set Parameter + case 5: + { + // Set parameter value + int32 paramIndex; + const auto param = _graph.GetParameter((Guid)node->Values[0], paramIndex); + if (param) + { + context.Data->Parameters[paramIndex].Value = tryGetValue(node->GetBox(1), 1, Value::Null); + } + + // Pass over the pose + value = tryGetValue(node->GetBox(2), Value::Null); + break; + } default: break; }