API ReferenceGE Extensionsflowgraphnodesrecording
Record Camera (Flowgraph Node)
- **Node Name:** `Record Camera`
Overview
- Node Name:
Record Camera - Category:
repeat_f_duration - File:
extensions/flowgraph/nodes/recording/recordCamera.lua
Records a camera path using keyframes. Each snap impulse captures a position/rotation keyframe with a timestamp. When stopped, creates a SimPath with Marker objects in the scene.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
snap | flow (impulse) | Capture a keyframe at the current position/rotation |
stop | flow (impulse) | Stop recording and save the path |
pos | vec3 | Position for the keyframe |
rot | quat | Rotation for the keyframe |
prefix | string | Prefix for the generated SimPath object name |
Output Pins
| Pin | Type | Description |
|---|---|---|
filename | string | The generated SimPath object name |
Internals
self.path- array of{time, pos, rot}keyframe entries.self.startTime-os.clock()at execution start, used to compute relative timestamps.self.durationState-'inactive'→'started'→'finished'.
finishUp()
Creates a SimPath object, iterates over recorded keyframes, and creates Marker child objects with:
- Position and rotation from keyframe data.
timeToNextcomputed as the delta between consecutive keyframe timestamps.- Adds to
scenetree.MissionGroup.
How It Works
- Starts in
inactivestate. Firstsnapimpulse transitions tostarted. - While
started, eachsnapimpulse appends{time, pos, rot}toself.path. - When
stopfires, transitions tofinishedand callsfinishUp(). - The
drawMiddlecallback displays the current state and keyframe count in the editor.
Lua Code Example
-- Record a camera flythrough:
-- cameraTransform.pos → recordCamera.pos
-- cameraTransform.rot → recordCamera.rot
-- keyPress("F5") → recordCamera.snap
-- keyPress("F6") → recordCamera.stop
-- recordCamera.filename → can be used with cameraPath nodeKey Dependencies
createObject("SimPath")/createObject("Marker")- scene object creationscenetree.MissionGroup- parent for the created pathos.clock()- keyframe timing
Additional Methods
C:_executionStarted()
Called when graph execution starts. Used for initialization/reset.
C:init()
Initializes the node, setting up pins and default properties.
C:work()
Main work function called each frame/tick when the node is active.
See Also
- Play Replay (Flowgraph Node) - Related reference
- Record Replay (Flowgraph Node) - Related reference
- Start Auto Replay (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide