mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
Shane, 11-10: "include natively a blender api package in raea/blender using samchon/blendia as good starting place and get us to a solid scripting parity to the official blender python api. we will own this ourselves", and "make sure to add GodotJS which should add a more complete integration and bindings for godot integration". raea/blender (sdk/blender, started from samchon/blendia, MIT, and rewritten): bpy, bmesh, mathutils, bpy_extras and gpu typed from Blender 5.2.1's own RNA and docstrings (tools/gen.sh: 1809 structs, 2498 operators, 41 modules outside RNA; 102 of about 12 900 members any), run against a real Blender. Paths are lazy as Python's attribute access is (writes and calls sent in order, reads awaited, py.pin for a stable handle), errors are Python's (BlenderError), mathutils is computed in TypeScript with Blender's maths (1450 values within 1e-5 of Blender's), float arrays are the value Blender gives (Vector, Matrix, Euler, Quaternion, Color), a call that makes a thing by its type returns that class (tools/refine.py), node sockets are typed by name, and every argument can be given by keyword. `raea blender run SCRIPT.ts [FILE.blend] [ARGS...]` runs a script on raea's engine against a headless Blender (apps/tools blender_bridge.rs, runtime/calls blender.post); under Bun or Node it starts its own, or joins the person's Blender through raea's add-on (python/raea_blender). raea/godot (sdk/godot) on GodotJS (MIT): Godot 4.6.1's every class, singleton, enum and builtin typed from GodotJS's codegen, JavaScriptCore on the Mac and QuickJS-ng on Windows and Linux (no V8). `raea setup godot` downloads GodotJS's editor build pinned by size and sha256 (apps/tools godot.rs); `raea godot run SCRIPT.ts` bundles the script and runs its default export (a function given the SceneTree and ARGS, or a SceneTree subclass as the main loop) headless or with --window, --movie recording with Godot's Movie Maker (the window kept on top, the frame size from the project), a callback that throws stopping the run, RAEA_CWD with cwd() and resolve() for paths; `raea godot types` and `raea godot open` (godot_run.rs). The guides: raea guide bevy/blender gains "A step in TypeScript" and bevy/godot is new, each example type-checked with its SDK's tests (sdk/blender/test/guide.ts, sdk/godot/test/guide.ts) and run as shown; raea guide bevy routes to bevy/godot. Their raea-skills copies are 7497067 (branch blender-godot-ts, not pushed). sdk/tsconfig.base.json maps raea/blender and raea/godot; tools/release.sh ships @raea/blender's python/. Proven: sdk/blender's tsc and bun tests against Blender 5.2.1; sdk/godot's tsc and its 7 bun tests against the installed GodotJS; apps/tools godot_run's unit tests; post 07b's film (releases/0.1.1/src/engines), its left half built and keyed by raea/blender and its right half recorded by raea/godot.
12 lines
424 B
Python
12 lines
424 B
Python
# A background Blender serving raea/blender until its session says quit:
|
|
# RAEA_BLENDER_TOKEN=... blender --background [FILE.blend] --python headless.py
|
|
# raea/blender's launch() and `raea blender run SCRIPT.ts` start it this way and read the ready line it prints.
|
|
import os
|
|
import sys
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
from raea_blender import server # noqa: E402
|
|
|
|
server.serve_headless()
|