DDDBrowserExporter
Inherits: RefCounted < Object
Exports a scene tree to a DDDBrowser page (OBJ/MTL meshes, scene JSON, discovery HTML).
Description
Walks a normal Blazium scene (and optional DDDBrowserLevel metadata) into DDDBrowser scene.json plus assets.
Dedicated nodes (DDDBrowserSpawn, DDDBrowserModel, portals, volumes, textbox/picturebox/audio/font/script) win over heuristics when both apply.
Normal-scene heuristics: first Camera3D or a Marker3D named Spawn → spawn; MeshInstance3D / StaticBody3D → OBJ+MTL model (+ albedo textures and CollisionShape3D colliders); Light3D; AudioStreamPlayer3D (wav/ogg); Label3D → textbox; Sprite3D / DDDBrowserPicturebox → picturebox; WorldEnvironment sky → skybox.uri when level skybox is unset.
LuauScript: attached .luau / LuauScript resources on exported instances are copied into scripts/ and wired as instances[].script (source passthrough). Prefer attaching a Blazium Luau gdclass extending Node3D; DDDBrowser runs _ready / _process via its gdclass compatibility layer.
Skipped with warning: rigid/character physics semantics, AnimationPlayer, CSG (unless already a baked mesh), unsupported collision shapes / streams.
Call get_last_warning() after export for skip/heuristic messages.
Methods
build_scene_dictionary(root: Node, export_dir: String) |
|
export_scene(root: Node, export_dir: String, generate_html: bool = true) |
|
get_last_error() const |
|
get_last_warning() const |
|
get_validation_errors(scene: Dictionary) const |
|
validate_scene_dictionary(scene: Dictionary) const |
Method Descriptions
Dictionary build_scene_dictionary(root: Node, export_dir: String) 🔗
Walks root and writes mesh/script/audio/texture assets under export_dir, returning the scene dictionary used for scene.json.
Error export_scene(root: Node, export_dir: String, generate_html: bool = true) 🔗
Builds the scene dictionary, writes scene.json, and optionally generates discovery HTML under export_dir. Returns @GlobalScope.OK on success.
String get_last_error() const 🔗
Returns the last hard export error message, or an empty string if none.
String get_last_warning() const 🔗
Returns joined skip/heuristic warnings from the last export or build, or an empty string if none.
PackedStringArray get_validation_errors(scene: Dictionary) const 🔗
Returns human-readable validation problems for scene, or an empty array when valid.
bool validate_scene_dictionary(scene: Dictionary) const 🔗
Returns true if scene passes schema-oriented validation checks used before writing.