mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Nodes - Renamed easing nodes to transition nodes
This commit is contained in:
1 parent
6240e42e74
commit
ea4ada7a8c
18 files changed
+163
-81
No files matched your search
@@ -1,20 +0,0 @@
|
||||
using Artemis.Core;
|
||||
using Artemis.VisualScripting.Nodes.Easing.Screens;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing;
|
||||
|
||||
[Node("Easing Type", "Outputs a selectable easing type.", "Easing", OutputType = typeof(Easings.Functions))]
|
||||
public class EasingTypeNode : Node<Easings.Functions, EasingTypeNodeCustomViewModel>
|
||||
{
|
||||
public EasingTypeNode()
|
||||
{
|
||||
Output = CreateOutputPin<Easings.Functions>();
|
||||
}
|
||||
|
||||
public OutputPin<Easings.Functions> Output { get; }
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Output.Value = Storage;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing.Screens;
|
||||
|
||||
public class EasingTypeNodeCustomView : ReactiveUserControl<EasingTypeNodeCustomViewModel>
|
||||
{
|
||||
public EasingTypeNodeCustomView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Mathematics;
|
||||
|
||||
[Node("Normalize", "Normalizes the number into range between 0-1",
|
||||
"Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
|
||||
[Node("Normalize", "Normalizes the number into range between 0-1", "Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
|
||||
public class NormalizeNode : Node
|
||||
{
|
||||
public InputPin<Numeric> Input { get; }
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing;
|
||||
namespace Artemis.VisualScripting.Nodes.Mathematics;
|
||||
|
||||
[Node("Numeric Easing", "Interpolates a value from 0-1 to 0-1 with the given function",
|
||||
"Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
|
||||
[Node("Numeric Easing", "Interpolates a value from 0-1 to 0-1 with the given function", "Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
|
||||
public class NumericEasingNode : Node
|
||||
{
|
||||
public InputPin<Numeric> Input { get; }
|
||||
@@ -15,7 +14,7 @@ public class NumericEasingNode : Node
|
||||
public NumericEasingNode()
|
||||
{
|
||||
Input = CreateInputPin<Numeric>("Input");
|
||||
EasingFunction = CreateInputPin<Easings.Functions>("EasingFunction");
|
||||
EasingFunction = CreateInputPin<Easings.Functions>("Function");
|
||||
|
||||
Result = CreateOutputPin<Numeric>();
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,9 +1,9 @@
|
||||
using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing;
|
||||
namespace Artemis.VisualScripting.Nodes.Transition;
|
||||
|
||||
[Node("Color Gradient Easing", "Outputs an eased color gradient value", "Easing", InputType = typeof(ColorGradient), OutputType = typeof(ColorGradient))]
|
||||
public class ColorGradientEasingNode : Node
|
||||
[Node("Color Gradient Transition", "Outputs smoothly transitioned changes to the input color gradient", "Transition", InputType = typeof(ColorGradient), OutputType = typeof(ColorGradient))]
|
||||
public class ColorGradientTransitionNode : Node
|
||||
{
|
||||
private DateTime _lastEvaluate = DateTime.MinValue;
|
||||
private float _progress;
|
||||
@@ -11,11 +11,11 @@ public class ColorGradientEasingNode : Node
|
||||
private ColorGradient? _sourceValue;
|
||||
private ColorGradient? _targetValue;
|
||||
|
||||
public ColorGradientEasingNode()
|
||||
public ColorGradientTransitionNode()
|
||||
{
|
||||
Input = CreateInputPin<ColorGradient>();
|
||||
EasingTime = CreateInputPin<Numeric>("delay");
|
||||
EasingFunction = CreateInputPin<Easings.Functions>("function");
|
||||
EasingTime = CreateInputPin<Numeric>("Delay");
|
||||
EasingFunction = CreateInputPin<Easings.Functions>("Function");
|
||||
|
||||
Output = CreateOutputPin<ColorGradient>();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Artemis.Core;
|
||||
using Artemis.VisualScripting.Nodes.Transition.Screens;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Transition;
|
||||
|
||||
[Node("Easing Function", "Outputs a selectable easing function", "Transition", OutputType = typeof(Easings.Functions))]
|
||||
public class EasingFunctionNode : Node<Easings.Functions, EasingFunctionNodeCustomViewModel>
|
||||
{
|
||||
public EasingFunctionNode()
|
||||
{
|
||||
Output = CreateOutputPin<Easings.Functions>();
|
||||
}
|
||||
|
||||
public OutputPin<Easings.Functions> Output { get; }
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Output.Value = Storage;
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing;
|
||||
namespace Artemis.VisualScripting.Nodes.Transition;
|
||||
|
||||
[Node("Numeric Transition", "Outputs an eased numeric value", "Easing", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
|
||||
[Node("Numeric Transition", "Outputs smoothly transitioned changes to the input numeric value", "Transition", InputType = typeof(Numeric), OutputType = typeof(Numeric))]
|
||||
public class NumericTransitionNode : Node
|
||||
{
|
||||
private float _currentValue;
|
||||
@@ -14,8 +14,8 @@ public class NumericTransitionNode : Node
|
||||
public NumericTransitionNode()
|
||||
{
|
||||
Input = CreateInputPin<Numeric>();
|
||||
EasingTime = CreateInputPin<Numeric>("delay");
|
||||
EasingFunction = CreateInputPin<Easings.Functions>("function");
|
||||
EasingTime = CreateInputPin<Numeric>("Delay");
|
||||
EasingFunction = CreateInputPin<Easings.Functions>("Function");
|
||||
|
||||
Output = CreateOutputPin<Numeric>();
|
||||
}
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
using Artemis.Core;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing;
|
||||
namespace Artemis.VisualScripting.Nodes.Transition;
|
||||
|
||||
[Node("Color Easing", "Outputs an eased color value", "Easing", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class SKColorEasingNode : Node
|
||||
[Node("Color Transition", "Outputs smoothly transitioned changes to the input color", "Transition", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class SKColorTransitionNode : Node
|
||||
{
|
||||
private SKColor _currentValue;
|
||||
private DateTime _lastEvaluate = DateTime.MinValue;
|
||||
@@ -12,11 +12,11 @@ public class SKColorEasingNode : Node
|
||||
private SKColor _sourceValue;
|
||||
private SKColor _targetValue;
|
||||
|
||||
public SKColorEasingNode()
|
||||
public SKColorTransitionNode()
|
||||
{
|
||||
Input = CreateInputPin<SKColor>();
|
||||
EasingTime = CreateInputPin<Numeric>("delay");
|
||||
EasingFunction = CreateInputPin<Easings.Functions>("function");
|
||||
EasingTime = CreateInputPin<Numeric>("Delay");
|
||||
EasingFunction = CreateInputPin<Easings.Functions>("Function");
|
||||
|
||||
Output = CreateOutputPin<SKColor>();
|
||||
}
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:screens="clr-namespace:Artemis.VisualScripting.Nodes.Easing.Screens"
|
||||
xmlns:screens="clr-namespace:Artemis.VisualScripting.Nodes.Transition.Screens"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.VisualScripting.Nodes.Easing.Screens.EasingTypeNodeCustomView"
|
||||
x:DataType="screens:EasingTypeNodeCustomViewModel">
|
||||
x:Class="Artemis.VisualScripting.Nodes.Transition.Screens.EasingFunctionNodeCustomView"
|
||||
x:DataType="screens:EasingFunctionNodeCustomViewModel">
|
||||
<ComboBox Classes="condensed" MinWidth="75" Items="{CompiledBinding EasingViewModels}" SelectedItem="{CompiledBinding SelectedEasingViewModel}" />
|
||||
</UserControl>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Transition.Screens;
|
||||
|
||||
public class EasingFunctionNodeCustomView : ReactiveUserControl<EasingFunctionNodeCustomViewModel>
|
||||
{
|
||||
public EasingFunctionNodeCustomView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -5,26 +5,26 @@ using Artemis.UI.Shared.Services.NodeEditor.Commands;
|
||||
using Artemis.UI.Shared.VisualScripting;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing.Screens;
|
||||
namespace Artemis.VisualScripting.Nodes.Transition.Screens;
|
||||
|
||||
public class EasingTypeNodeCustomViewModel : CustomNodeViewModel
|
||||
public class EasingFunctionNodeCustomViewModel : CustomNodeViewModel
|
||||
{
|
||||
private readonly EasingTypeNode _node;
|
||||
private readonly EasingFunctionNode _node;
|
||||
private readonly INodeEditorService _nodeEditorService;
|
||||
|
||||
public EasingTypeNodeCustomViewModel(EasingTypeNode node, INodeScript script, INodeEditorService nodeEditorService) : base(node, script)
|
||||
public EasingFunctionNodeCustomViewModel(EasingFunctionNode node, INodeScript script, INodeEditorService nodeEditorService) : base(node, script)
|
||||
{
|
||||
_node = node;
|
||||
_nodeEditorService = nodeEditorService;
|
||||
|
||||
NodeModified += (_, _) => this.RaisePropertyChanged(nameof(SelectedEasingViewModel));
|
||||
EasingViewModels =
|
||||
new ObservableCollection<EasingTypeNodeEasingViewModel>(Enum.GetValues(typeof(Easings.Functions)).Cast<Easings.Functions>().Select(e => new EasingTypeNodeEasingViewModel(e)));
|
||||
new ObservableCollection<EasingFunctionViewModel>(Enum.GetValues(typeof(Easings.Functions)).Cast<Easings.Functions>().Select(e => new EasingFunctionViewModel(e)));
|
||||
}
|
||||
|
||||
public ObservableCollection<EasingTypeNodeEasingViewModel> EasingViewModels { get; }
|
||||
public ObservableCollection<EasingFunctionViewModel> EasingViewModels { get; }
|
||||
|
||||
public EasingTypeNodeEasingViewModel? SelectedEasingViewModel
|
||||
public EasingFunctionViewModel? SelectedEasingViewModel
|
||||
{
|
||||
get => EasingViewModels.FirstOrDefault(e => e.EasingFunction == _node.Storage);
|
||||
set
|
||||
+3
-3
@@ -2,10 +2,10 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:screens="clr-namespace:Artemis.VisualScripting.Nodes.Easing.Screens"
|
||||
xmlns:screens="clr-namespace:Artemis.VisualScripting.Nodes.Transition.Screens"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.VisualScripting.Nodes.Easing.Screens.EasingTypeNodeEasingView"
|
||||
x:DataType="screens:EasingTypeNodeEasingViewModel">
|
||||
x:Class="Artemis.VisualScripting.Nodes.Transition.Screens.EasingFunctionView"
|
||||
x:DataType="screens:EasingFunctionViewModel">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<Polyline Stroke="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
StrokeThickness="1"
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing.Screens;
|
||||
namespace Artemis.VisualScripting.Nodes.Transition.Screens;
|
||||
|
||||
public class EasingTypeNodeEasingView : UserControl
|
||||
public class EasingFunctionView : UserControl
|
||||
{
|
||||
public EasingTypeNodeEasingView()
|
||||
public EasingFunctionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
+3
-3
@@ -3,11 +3,11 @@ using Artemis.UI.Shared;
|
||||
using Avalonia;
|
||||
using Humanizer;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing.Screens;
|
||||
namespace Artemis.VisualScripting.Nodes.Transition.Screens;
|
||||
|
||||
public class EasingTypeNodeEasingViewModel : ViewModelBase
|
||||
public class EasingFunctionViewModel : ViewModelBase
|
||||
{
|
||||
public EasingTypeNodeEasingViewModel(Easings.Functions easingFunction)
|
||||
public EasingFunctionViewModel(Easings.Functions easingFunction)
|
||||
{
|
||||
EasingFunction = easingFunction;
|
||||
Description = easingFunction.Humanize();
|
||||
Reference in new issue
Block a user