From 590a892f16345217231cdca96bfdad2cf08acfd7 Mon Sep 17 00:00:00 2001 From: Ruan Lucas <79365912+RuanLucasGD@users.noreply.github.com> Date: Tue, 18 Jul 2023 21:54:30 -0400 Subject: [PATCH] set spline point as selected when has a tangent selected and set as linear --- Source/Editor/CustomEditors/Dedicated/SplineEditor.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Editor/CustomEditors/Dedicated/SplineEditor.cs b/Source/Editor/CustomEditors/Dedicated/SplineEditor.cs index 4ddf5c26c..4dc0643d3 100644 --- a/Source/Editor/CustomEditors/Dedicated/SplineEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/SplineEditor.cs @@ -6,6 +6,7 @@ using FlaxEngine; using FlaxEngine.GUI; using FlaxEditor.CustomEditors.Elements; using System; +using FlaxEditor.SceneGraph; namespace FlaxEditor.CustomEditors.Dedicated { @@ -99,6 +100,14 @@ namespace FlaxEditor.CustomEditors.Dedicated public override void OnSetMode(Spline spline, int index) { SetKeyframeLinear(spline, index); + + // if has a tangent selected, change the selection to tangent parent (a spline point / keyframe) + var currentSelection = Editor.Instance.SceneEditing.Selection; + if (currentSelection.Count == 1 && currentSelection[0] is SplineNode.SplinePointTangentNode) + { + var selectedTangentNode = currentSelection[0] as SplineNode.SplinePointTangentNode; + Editor.Instance.SceneEditing.Select(selectedTangentNode.ParentNode); + } } private void SetKeyframeLinear(Spline spline, int index)