Skip to main content

Flow

The ScriptFlow plugin provides a visual logic editor for Tellusim Engine applications. It enables node-based script authoring through a graph-based user interface, allowing users to visually create, edit, and preview logic.

ScriptFlow dynamically generates C++ source code that integrates seamlessly with GraphScript, NodeScript, and MaterialScript objects. This approach enables rapid prototyping and intuitive visual programming while preserving C++-level performance, as the generated scripts execute the same way as handcrafted C++ code.

info

ScriptFlow is built on top of the ControlFlowCPP node editor and Reflection plugin.

info

This plugin is integrated into Tellusim Explorer.

#include <system/flow/include/TellusimSystemFlow.h>

Example

// Create ScriptFlow
ScriptFlow script_flow(&right_panel);
if(!script_flow.create()) return false;
script_flow.setType("NodeScript");

// ScriptFlow change callback
script_flow.setChangedCallback([&](ScriptFlow *flow) {
if(flow->getSource()) node_script.create(flow->getSource());
node_script.updateScene();
});

// Undo/redo actions
if(window.getKeyboardKey('z', true) && window.getKeyboardKey(Window::KeyOption)) {
if(window.getKeyboardKey(Window::KeyShift)) script_flow.redo();
else script_flow.undo();
}
if(window.getKeyboardKey('y', true) && window.getKeyboardKey(Window::KeyOption)) {
script_flow.redo();
}