mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Nodes - Added categories
Nodes - Added quick node creation Nodes - Added input and output types to NodeAttribute
This commit is contained in:
1 parent
73794591bc
commit
c4340c3c97
29 files changed
+389
-82
No files matched your search
@@ -3,7 +3,7 @@ using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes
|
||||
{
|
||||
[Node("Greater than", "Checks if the first input is greater than the second.")]
|
||||
[Node("Greater than", "Checks if the first input is greater than the second.", "Operators", InputType = typeof(object), OutputType = typeof(bool))]
|
||||
public class GreaterThanNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -44,7 +44,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("Less than", "Checks if the first input is less than the second.")]
|
||||
[Node("Less than", "Checks if the first input is less than the second.", "Operators", InputType = typeof(object), OutputType = typeof(bool))]
|
||||
public class LessThanNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -85,7 +85,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("Equals", "Checks if the two inputs are equals.")]
|
||||
[Node("Equals", "Checks if the two inputs are equals.", "Operators", InputType = typeof(bool), OutputType = typeof(bool))]
|
||||
public class EqualsNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -126,7 +126,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("Negate", "Negates the boolean.")]
|
||||
[Node("Negate", "Negates the boolean.", "Operators", InputType = typeof(bool), OutputType = typeof(bool))]
|
||||
public class NegateNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
@@ -3,7 +3,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("Brighten Color", "Brightens a color by a specified amount in percent")]
|
||||
[Node("Brighten Color", "Brightens a color by a specified amount in percent", "Color", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class BrightenSKColorNode : Node
|
||||
{
|
||||
public BrightenSKColorNode() : base("Brighten Color", "Brightens a color by a specified amount in percent")
|
||||
@@ -20,7 +20,7 @@ namespace Artemis.VisualScripting.Nodes.Color
|
||||
public override void Evaluate()
|
||||
{
|
||||
Input.Value.ToHsl(out float h, out float s, out float l);
|
||||
l *= (Percentage.Value + 100f) / 100f;
|
||||
l += l * (Percentage.Value / 100f);
|
||||
Output.Value = SKColor.FromHsl(h, s, l);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("Darken Color", "Darkens a color by a specified amount in percent")]
|
||||
[Node("Darken Color", "Darkens a color by a specified amount in percent", "Color", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class DarkenSKColorNode : Node
|
||||
{
|
||||
public DarkenSKColorNode() : base("Darken Color", "Darkens a color by a specified amount in percent")
|
||||
@@ -20,7 +20,7 @@ namespace Artemis.VisualScripting.Nodes.Color
|
||||
public override void Evaluate()
|
||||
{
|
||||
Input.Value.ToHsl(out float h, out float s, out float l);
|
||||
l *= (Percentage.Value * -1 + 100f) / 100f;
|
||||
l -= l * (Percentage.Value / 100f);
|
||||
Output.Value = SKColor.FromHsl(h, s, l);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("Desaturate Color", "Desaturates a color by a specified amount in percent")]
|
||||
[Node("Desaturate Color", "Desaturates a color by a specified amount in percent", "Color", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class DesaturateSKColorNode : Node
|
||||
{
|
||||
public DesaturateSKColorNode() : base("Desaturate Color", "Desaturates a color by a specified amount in percent")
|
||||
@@ -21,9 +21,8 @@ namespace Artemis.VisualScripting.Nodes.Color
|
||||
public override void Evaluate()
|
||||
{
|
||||
Input.Value.ToHsl(out float h, out float s, out float l);
|
||||
s -= Percentage.Value;
|
||||
s = Math.Clamp(s, 0, 100);
|
||||
Output.Value = SKColor.FromHsl(h, s, l);
|
||||
s -= s * (Percentage.Value / 100f);
|
||||
Output.Value = SKColor.FromHsl(h, Math.Clamp(s, 0f, 100f), l);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("HSL Color", "Creates a color from hue, saturation and lightness values")]
|
||||
[Node("HSL Color", "Creates a color from hue, saturation and lightness values", "Color", InputType = typeof(float), OutputType = typeof(SKColor))]
|
||||
public class HslSKColorNode : Node
|
||||
{
|
||||
public HslSKColorNode() : base("HSL Color", "Creates a color from hue, saturation and lightness values")
|
||||
|
||||
@@ -3,7 +3,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("Invert Color", "Inverts a color by a specified amount in percent")]
|
||||
[Node("Invert Color", "Inverts a color by a specified amount in percent", "Color", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class InvertSKColorNode : Node
|
||||
{
|
||||
public InvertSKColorNode() : base("Invert Color", "Inverts a color")
|
||||
@@ -17,9 +17,12 @@ namespace Artemis.VisualScripting.Nodes.Color
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Input.Value.ToHsl(out float h, out float s, out float l);
|
||||
h += 180;
|
||||
Output.Value = SKColor.FromHsl(h % 360, s, l);
|
||||
Output.Value = new SKColor(
|
||||
(byte) (255 - Input.Value.Red),
|
||||
(byte) (255 - Input.Value.Green),
|
||||
(byte) (255 - Input.Value.Blue),
|
||||
Input.Value.Alpha
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("Rotate Color Hue", "Rotates the hue of a color by a specified amount in degrees")]
|
||||
[Node("Rotate Color Hue", "Rotates the hue of a color by a specified amount in degrees", "Color", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class RotateHueSKColorNode : Node
|
||||
{
|
||||
public RotateHueSKColorNode() : base("Rotate Color Hue", "Rotates the hue of a color by a specified amount in degrees")
|
||||
|
||||
@@ -4,7 +4,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("Saturate Color", "Saturates a color by a specified amount in percent")]
|
||||
[Node("Saturate Color", "Saturates a color by a specified amount in percent", "Color", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class SaturateSKColorNode : Node
|
||||
{
|
||||
public SaturateSKColorNode() : base("Saturate Color", "Saturates a color by a specified amount in percent")
|
||||
@@ -21,9 +21,8 @@ namespace Artemis.VisualScripting.Nodes.Color
|
||||
public override void Evaluate()
|
||||
{
|
||||
Input.Value.ToHsl(out float h, out float s, out float l);
|
||||
s += Percentage.Value;
|
||||
s = Math.Clamp(s, 0, 100);
|
||||
Output.Value = SKColor.FromHsl(h, s, l);
|
||||
s += s * (Percentage.Value / 100f);
|
||||
Output.Value = SKColor.FromHsl(h, Math.Clamp(s, 0f, 100f), l);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("Color-Value", "Outputs a configurable color value.")]
|
||||
[Node("Color-Value", "Outputs a configurable color value.", "Static", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class StaticSKColorValueNode : Node<StaticSKColorValueNodeCustomViewModel>
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
@@ -3,7 +3,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
[Node("Sum (Color)", "Sums the connected color values.")]
|
||||
[Node("Sum (Color)", "Sums the connected color values.", "Color", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class SumSKColorsNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes
|
||||
{
|
||||
[Node("To String", "Converts the input to a string.")]
|
||||
[Node("To String", "Converts the input to a string.", "Conversion", InputType = typeof(object), OutputType = typeof(string))]
|
||||
public class ConvertToStringNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -34,7 +34,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("To Integer", "Converts the input to an integer.")]
|
||||
[Node("To Integer", "Converts the input to an integer.", "Conversion", InputType = typeof(object), OutputType = typeof(int))]
|
||||
public class ConvertToIntegerNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -80,7 +80,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("To Double", "Converts the input to a double.")]
|
||||
[Node("To Double", "Converts the input to a double.", "Conversion", InputType = typeof(object), OutputType = typeof(double))]
|
||||
public class ConvertToDoubleNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -126,7 +126,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("To Float", "Converts the input to a float.")]
|
||||
[Node("To Float", "Converts the input to a float.", "Conversion", InputType = typeof(object), OutputType = typeof(float))]
|
||||
public class ConvertToFloatNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
@@ -7,7 +7,7 @@ using Stylet;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes
|
||||
{
|
||||
[Node("Data Model-Value", "Outputs a selectable data model value.")]
|
||||
[Node("Data Model-Value", "Outputs a selectable data model value.", "External")]
|
||||
public class DataModelNode : Node<DataModelNodeCustomViewModel>, IDisposable
|
||||
{
|
||||
private DataModelPath _dataModelPath;
|
||||
|
||||
@@ -3,7 +3,7 @@ using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing
|
||||
{
|
||||
[Node("Double Easing", "Outputs an eased double value")]
|
||||
[Node("Double Easing", "Outputs an eased double value", "Easing", InputType = typeof(double), OutputType = typeof(double))]
|
||||
public class DoubleEasingNode : Node
|
||||
{
|
||||
private DateTime _lastEvaluate = DateTime.MinValue;
|
||||
|
||||
@@ -3,7 +3,7 @@ using Artemis.VisualScripting.Nodes.Easing.CustomViewModels;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing
|
||||
{
|
||||
[Node("Easing Type", "Outputs a selectable easing type.")]
|
||||
[Node("Easing Type", "Outputs a selectable easing type.", "Easing", OutputType = typeof(Easings.Functions))]
|
||||
public class EasingTypeNode : Node<EasingTypeNodeCustomViewModel>
|
||||
{
|
||||
public EasingTypeNode() : base("Easing Type", "Outputs a selectable easing type.")
|
||||
|
||||
@@ -3,7 +3,7 @@ using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing
|
||||
{
|
||||
[Node("Float Easing", "Outputs an eased float value")]
|
||||
[Node("Float Easing", "Outputs an eased float value", "Easing", InputType = typeof(float), OutputType = typeof(float))]
|
||||
public class FloatEasingNode : Node
|
||||
{
|
||||
private DateTime _lastEvaluate = DateTime.MinValue;
|
||||
|
||||
@@ -3,7 +3,7 @@ using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing
|
||||
{
|
||||
[Node("Integer Easing", "Outputs an eased integer value")]
|
||||
[Node("Integer Easing", "Outputs an eased integer value", "Easing", InputType = typeof(int), OutputType = typeof(int))]
|
||||
public class IntEasingNode : Node
|
||||
{
|
||||
private DateTime _lastEvaluate = DateTime.MinValue;
|
||||
|
||||
@@ -4,7 +4,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Easing
|
||||
{
|
||||
[Node("Color Easing", "Outputs an eased color value")]
|
||||
[Node("Color Easing", "Outputs an eased color value", "Easing", InputType = typeof(SKColor), OutputType = typeof(SKColor))]
|
||||
public class SKColorEasingNode : Node
|
||||
{
|
||||
private DateTime _lastEvaluate = DateTime.MinValue;
|
||||
|
||||
@@ -6,7 +6,7 @@ using Artemis.VisualScripting.Nodes.CustomViewModels;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes
|
||||
{
|
||||
[Node("Layer/Folder Property", "Outputs the property of a selected layer or folder")]
|
||||
[Node("Layer/Folder Property", "Outputs the property of a selected layer or folder", "External")]
|
||||
public class LayerPropertyNode : Node<LayerPropertyNodeCustomViewModel>
|
||||
{
|
||||
private readonly object _layerPropertyLock = new();
|
||||
|
||||
@@ -3,7 +3,7 @@ using Artemis.VisualScripting.Nodes.CustomViewModels;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes
|
||||
{
|
||||
[Node("Integer-Value", "Outputs an configurable integer value.")]
|
||||
[Node("Integer-Value", "Outputs an configurable integer value.", "Static", OutputType = typeof(int))]
|
||||
public class StaticIntegerValueNode : Node<StaticIntegerValueNodeCustomViewModel>
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -34,7 +34,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("Double-Value", "Outputs a configurable double value.")]
|
||||
[Node("Double-Value", "Outputs a configurable double value.", "Static", OutputType = typeof(double))]
|
||||
public class StaticDoubleValueNode : Node<StaticDoubleValueNodeCustomViewModel>
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -65,7 +65,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("Float-Value", "Outputs a configurable float value.")]
|
||||
[Node("Float-Value", "Outputs a configurable float value.", "Static", OutputType = typeof(float))]
|
||||
public class StaticFloatValueNode : Node<StaticFloatValueNodeCustomViewModel>
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -99,7 +99,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("String-Value", "Outputs a configurable string value.")]
|
||||
[Node("String-Value", "Outputs a configurable string value.", "Static", OutputType = typeof(string))]
|
||||
public class StaticStringValueNode : Node<StaticStringValueNodeCustomViewModel>
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -127,8 +127,4 @@ namespace Artemis.VisualScripting.Nodes
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region CustomViewModels
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes
|
||||
{
|
||||
[Node("Format", "Formats the input string.")]
|
||||
[Node("Format", "Formats the input string.", "Text", InputType = typeof(object), OutputType = typeof(string))]
|
||||
public class StringFormatNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
@@ -3,7 +3,7 @@ using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes
|
||||
{
|
||||
[Node("Sum (Integer)", "Sums the connected integer values.")]
|
||||
[Node("Sum (Integer)", "Sums the connected integer values.", "Mathematics", InputType = typeof(int), OutputType = typeof(int))]
|
||||
public class SumIntegersNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -35,7 +35,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("Sum (Float)", "Sums the connected float values.")]
|
||||
[Node("Sum (Float)", "Sums the connected float values.", "Mathematics", InputType = typeof(float), OutputType = typeof(float))]
|
||||
public class SumFloatsNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
@@ -67,7 +67,7 @@ namespace Artemis.VisualScripting.Nodes
|
||||
#endregion
|
||||
}
|
||||
|
||||
[Node("Sum (Double)", "Sums the connected double values.")]
|
||||
[Node("Sum (Double)", "Sums the connected double values.", "Mathematics", InputType = typeof(double), OutputType = typeof(double))]
|
||||
public class SumDoublesNode : Node
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
Reference in new issue
Block a user