openFrameworks addon linking oF apps to the Godot editor: live parameter control plus a JSON scene loader
README
ofxGodot
openFrameworks addon linking oF apps to the Godot editor: live parameter control plus a JSON scene loader. Pairs with ofxGodotBridge (Godot editor plugin + GDExtension).Install
Clone into your openFrameworks addons folder as
ofxGodot:cd OF_ROOT/addons git clone https://github.com/danoli3/ofxGodot.git
Add to your app's
addons.make:ofxPoco ofxGodot
Layout
src/ofxGodotLink.h/.cpp— WebSocket server mirroring an
ofParameterGroup both ways (see protocol below). src/ofxGodotScene.h/.cpp— JSON scene loader + drawer (transforms,
example/— headless demo: param group + link + scene draw.demo-link-test.py— wire gate for the example (stdlib only).
Usage
#include "ofxGodot.h"
ofParameterGroup params;
ofParameter<float> speed;
ofxGodotLink link;
ofxGodotScene scene;
void ofApp::setup() {
params.setName("demo");
params.add(speed.set("speed", 1.5f, 0.0f, 10.0f));
link.setSceneCallback([this](const ofJson & s) { return scene.load(s); });
link.setup(params, 17432);
}
void ofApp::update() {
link.update(); // pump inbound commands, flush outbound; call every frame
}
void ofApp::draw() {
scene.draw();
}
void ofApp::exit() {
link.exit();
}Threading: the server reads on its own threads, but every socket write and every parameter touch happens in
update(), same shape as ofxOscParameterSync.Link protocol (v1)
Godot → oF:
{"cmd":"set","name":"group/param","value":…}{"cmd":"loadScene","scene":{…}}{"cmd":"schema"}
{"type":"update","name":…,"value":…}{"type":"schema","params":[{name,kind,value,min?,max?}]}{"type":"sceneResult","ok":bool}
/ are ambiguous (v1 limitation). Supported kinds: bool, int, float, double, string, vec2, vec3, vec4, color. The first update() after setup pushes full state; remote-applied values update the baseline so they never echo.Scene schema:
nodes[] with position/rotation (XYZ euler degrees) / scale, mesh{box,sphere,plane,cylinder,cone}, material{diffuse, emissive}, light{point,spot,directional}, camera{fov}. See ofxGodotScene.h for the exact shape.Test
cd example && make python3 ../demo-link-test.py
Expect
LIVE_RESULT=PASS. (Rerun in a real terminal if you get SKIP — sandboxed shells block bind().) Headless oF apps still run draw() against a noop renderer: anything issuing raw GL (e.g. ofDrawBitmapStringHighlight) segfaults there, so the example guards it — see example/src/ofApp.cpp.License
MIT, see LICENSE.
ofxAddons