Visual Scripting with PixaFlux

Algorithm can be visualized as graphs where the operations are Nodes and the values flow between these nodes through Connections.

For example, the operation:

(6.0 ÷ 3.0) + (2.0 × 4.0)

can be visualized as this graph:

Visual Scripting Math



In PixaFlux this operation can be defined with nodes and connections:

Visual Scripting PixaFlux

Node Values

The Connection between two Nodes represents a value that flows from the output of one node to the input of other node.

Visual Scripting Math Sqrt

In the above image:

PixaFlux supports the following types of Node Values:

Common Attributes

A Node in PixaFlux has Inputs, Outputs and Attributes. Inputs and Attributes can both be considered inputs of the operation that the node executes.

PixaFlux includes an Attributes Node that allows artists to create common attributes for the project, and node Attributes can be exposed as Inputs of the node.

This way two or more nodes can be affected by the same attribute in a consistent way:

Visual Scripting Common Attributes

In this project:

This feature allows Attributes to be reused on the Node Graph and affect multiple nodes.

The Attributes node converts its attributes to Node Values. This is how they are converted:

Attribute Value Types to Node Value Types

You can add to a PixaFlux project as Attributes nodes as you need, but the names of the attributes need to be unique across the project.

To learn more about this feature please do the following tutorials

Reusable Node Graphs

Node Graph projects are algorithms, and one of the main advantages of algorithms is that they can be reused.

PixaFlux projects can be saved to a PXF file and be reused in other projects using the Node Graph node.

All attributes defined in Attributes nodes are common attributes of the project.

The Inputs and Outputs of the project can be defined with the Input-Output (IO) nodes.

Double Border Project

Visual Scripting Double Border

This project applies a two color border to an image, and it contains all the necessary nodes to be reused in other projects:

This project is saved in a file Double_Border.pxf.

Node Graph Node - Double Border

This project has a Node Graph node Node Graph icon that loads Double_Border.pxf. The Double Border node applies the two borders to the image with the border size and colors defined in the attributes of the Node Graph node.

Visual Scripting Node Graph Double Border

When the Node Graph node loads a PixaFlux project it executes the following actions:

Reusable Node Graphs - Loops

The Node Graph node includes an iterations attribute. This attribute controls the number of iterations the Node Graph is executed.

The IO nodes support the incremental modification of output values, which are then used as inputs for the next iteration.

The total number of iterations and the current iteration are provided to the custom project in a Node Iterations node.

Double Border Loop Project

Visual Scripting Double Border Loop

This project is similar to the Double Border project but it has some modifications to support loops:

Node Graph Node - Double Border Loop

Visual Scripting Node Graph Double Border Loop

When the Node Graph node loads a PixaFlux project it executes this actions to support loops:

When the Node Graph node is executed: