Flowgraph Base Module
Base class factory for flowgraph modules. Modules are manager-level components that provide shared state and services to flowgraph nodes (e.g., button management, camera paths, file I/O).
Base class factory for flowgraph modules. Modules are manager-level components that provide shared state and services to flowgraph nodes (e.g., button management, camera paths, file I/O).
Public Functions
| Function | Signature | Returns | Description |
|---|---|---|---|
createBase | createBase(...) | module instance | Creates a new base module instance. Sets up the metatable, calls init(mgr) with the provided arguments. |
use | use(mgr, derivedClass) | module instance | Creates a base instance, then overlays all fields from derivedClass onto it. If the derived class defines its own init, calls it after merging. This is the standard factory for creating concrete modules. |
Base Class (C) Methods
| Method | Signature | Description |
|---|---|---|
init | init(mgr) | Stores the manager reference as self.mgr. Called during construction. |
clear | clear() | No-op placeholder for module cleanup. Override in derived modules. |
onUpdate | onUpdate(dtReal, dtSim, dtRaw) | Per-frame update hook. Override for continuous logic. |
executionStopped | executionStopped() | Called when flowgraph execution stops. Override for teardown. |
executionStarted | executionStarted() | Called when flowgraph execution begins. Override for setup. |
onClear | onClear() | Delegates to executionStopped(). |
Base Class Properties
| Property | Type | Description |
|---|---|---|
moduleOrder | number | Sorting priority (lower runs first). Default: 0. |
hooks | table | Empty table; derived modules list hook names they want to receive. |
Usage Pattern
All concrete flowgraph modules use _flowgraph_createModule(C) which calls M.use() internally:
-- Defining a custom module (e.g., modules/myModule.lua)
local C = {}
C.moduleOrder = 100
function C:init()
self:clear()
end
function C:clear()
self.myState = {}
end
function C:onUpdate(dtReal, dtSim, dtRaw)
-- per-frame logic
end
function C:executionStopped()
self:clear()
end
return _flowgraph_createModule(C)Factory Internals
-- createBase: raw construction
function M.createBase(...)
local o = {}
setmetatable(o, C)
C.__index = C
o:init(...)
return o
end
-- use: construction + derived class mixin
function M.use(mgr, derivedClass)
local o = M.createBase(mgr)
local baseInit = o.init
for k, v in pairs(derivedClass) do
o[k] = v -- overlay derived methods/properties
end
if o.init ~= baseInit then
o:init() -- call derived init if overridden
end
return o
endSee Also
- Flowgraph Base State Node - Related reference
- Flowgraph Base Node - Related reference
- Flowgraph Node Builder - Related reference
- FlowGraph Guide - Guide
Vehicle Editor - Static Render View
Manages multiple independent render views for the static vehicle editor, with 3D/orthographic modes, axis gizmo navigation, grid overlays, and WASD camera control.
Flowgraph Base Node
Core base class for all flowgraph nodes. Defines the complete node lifecycle: initialization, pin management, work execution, drawing, serialization, and context menus. Every flowgraph node inherits f