GameAPI Builder — script_ml Handle & Function Reference


1. Handle Types

HandleRepresents / Points ToNotes / Usage
MLMainLoopItem objectNode in the main loop. Returned by creation or rendering functions. Can be attached to MN via move_ml.
MNMove Node (scene transform)Live transform for single-object placement. Used with move_ml.
TFTinyGLTF resourceRaw GLTF model data (nodes, meshes, animations). Can be decimated (TF→TF).
PPolygon meshGeometry data. Combinable via p_or_elem or p_or_array. Renderable via MT → ML. Can be decimated (P→P).
MTMaterial / render interfaceEncapsulates material/shader state. Supports single-object (m_bind) and instanced rendering (m_bind_inst).
PTSPoints arrayPositions for instanced rendering. Used with m_bind_inst.
MSMatrices arrayTransform matrices for instanced rendering. Used with m_bind_inst.
OVolume objectVolumetric data (density, signed distance field). Non-renderable.
VXVoxel objectRenderable voxel mesh derived from volume (O). Can be passed to m_bind or m_bind_inst.

2. Core Functions

FunctionSignatureDescription / Notes
move_ml(ML node, MN transform) -> MLAttaches a main-loop node to a scene transform. Returns updated ML node.
m_bind(P or VX, MT) -> MLBinds a single polygon or voxel mesh to a material, producing an ML node.
m_bind_inst(P or VX, PTS or MS, MT) -> MLBinds a mesh to a material for instanced rendering. Positions or matrices define per-instance transforms.
p_or_elem(P, P) -> PCombines two polygon meshes into one. Used for precalc/mesh preparation.
p_or_array([P]) -> PCombines multiple polygon meshes into a single mesh.
volume_to_voxels(O) -> VXConverts a volumetric object into a renderable voxel mesh (VX).
ml_gltf_all(TF) -> MLConverts entire GLTF resource into a main-loop node representing the full scene.
ml_gltf_all_inst(TF, PTS or MS) -> MLInstanced GLTF render: creates multiple scene instances from a GLTF resource.
ml_gltf_all_lod(TF, float[] distances) -> MLGLTF LOD render: creates an ML node with automatic level-of-detail switching.
decimate (TF)(TF, float ratio) -> TFReduces detail of a GLTF resource. ratio ∈ [0..1].
decimate (P)(P, float ratio) -> PReduces polygon count of a mesh. ratio ∈ [0..1].

Kommentit