Audectra Node SDK - Release Notes
v1.0.10
This SDK version is supported within Studio and Stage starting with v2023.3.
SKColor as Node Setting
It is now possible to use SKColor
as a node setting property type.
[RenderNode(Name = "Color Fill")]
public class FillColorNode : RenderNodeBase
{
[NodeSetting]
public SKColor Color { get; set; }
// ...
}
These properties can now be configured via the property editor panel in studio.
Node Description
Add a description to your node via the node attribute, like so.
[RenderNode(Name = "Color Fill", Description = "Fills the canvas with the provided input color.")]
public class FillColorNode : RenderNodeBase
{
// ...
}
This description will be shown within the node library in studio.
Node Tags
You can now specify a collection of predefined or custom tags for each signal or render node.
[RenderNode(Name = "Beat Color Fill", Tags = new []{ NodeTags.RhythmBased, "custom-tag" })]
public class BeatFillColorNode : RenderNodeBase
{
// ...
}
These tags will be shown within the node library in studio.
Target Canvas Type
Furthermore, you are now able to specify for what kind of target canvas your render nodes are designed for. For example, this render node here is designed to be used within a single pixel canvas.
[RenderNode(Name = "Color Fill", TargetCanvas = CanvasType.Pixel })]
public class FillColorNode : RenderNodeBase
{
// ...
}
Currently, the available target canvas types are
- Pixel: pixel canvas with one single pixel (0D).
- Strip: strip canvas with addressable pixels in one direction (1D).
- Panel: panel canvas with addressable pixels in two directions (2D).
This information will be displayed to the user via the node library, allowing the user to choose appropiate render nodes for their visualization canvas type. The default canvas type is panel.
Additional Base Classes for Render Nodes
In addition to the base class RenderNodeBase
, there are now two more specialized base classes available PixelRenderNodeBase
and StripRenderNodeBase
. Like their names suggest, these base classes can be used for render nodes that target either pixel or strip canvas types.
Pixel Render Node Base
The base class PixelRenderNodeBase
is designed to simplify creating render nodes that target a pixel canvas type, where the color is mapped accross the whole canvas.
Info
Using this base class will override the TargetCanvas
to Pixel
.
Here is an example of such a render node, which takes in a color as node input, and applies it to the whole canvas.
[RenderNode(Name = "Color Fill")]
public class FillColorNode : PixelRenderNodeBase
{
[NodeInput]
public SKColor Color { get; set; }
public FillColorNode(IExtensionApi api, int canvasWidth, int canvasHeight)
: base(api, canvasWidth, canvasHeight)
{
}
// Notice, how this method only returns a single color.
protected override SKColor RenderPixel() => Color;
}
Strip Render Node Base
The base class StripRenderNodeBase
is designed to simplify creating render nodes that target a strip canvas type, where addressable pixels are aligned along the longer side of the canvas. The other canvas dimension will be duplicated from the initial strip line.
Info
Using this base class will override the TargetCanvas
to Strip
.
Here is an example render node that defines a gradient from one input color to another across the strip canvas.
[RenderNode(Name = "Strip Gradient Fill")]
public class StripGradientFillColorNode : StripRenderNodeBase
{
[NodeInput]
public SKColor ColorBegin { get; set; }
[NodeInput]
public SKColor ColorEnd { get; set; }
public StripGradientFillColorNode(IExtensionApi api, int canvasWidth, int canvasHeight)
: base(api, canvasWidth, canvasHeight)
{
}
// Notice, how this method draws a rectangle with one pixel height accross the strip length.
protected override void RenderStrip(SKCanvas canvas)
{
canvas.Clear();
using var paint = new SKPaint();
paint.Style = SKPaintStyle.Fill;
paint.Shader = SKShader.CreateLinearGradient(new SKPoint(0, 0),
new SKPoint(StripLength, 0),
new[] { ColorBegin, ColorEnd },
SKShaderTileMode.Clamp);
canvas.DrawRect(0, 0, StripLength, 1, paint);
}
}
v1.0.14
This SDK version is supported within Studio and Stage starting with v2023.4.
OnRenderInitialize and OnRenderTerminate
Added two additional optional methods to the render nodes, which allows to initialize/free resources within the node. These two threads will be both called within the render thread.