Builtin Library
README.md
prefab.record (procNode)
One entity record of a prefab, the reusable entity template a spawn copies: its name, its id inside the prefab, the id of its parent, its local pose, its components and its native components. The records of a prefab are the entities a spawn makes, in order. prefab.empty, prefab.from_geometry, prefab.from_geometries, prefab.from_population and prefab.from_asset build their records with it; use it to write an entity whole and join it on with prefab.edit (what = "join"). The parts a graph builds and parents itself are elements: elements.entity makes one and elements.link parents it under another.
Inputs
name(String, default ""). The entity's name. An empty string takesfallback.fallback(String, default "entity"). The name an emptynametakes.id(String, default "0"). The record's id inside the prefab, whichparentids of other records name.parent(String, optional). The id of the record this one hangs under. Unwired, the record is a root.components(List<Record>, optional). The components the entity carries, each{ type, data }. Unwired, the entity carries none.ecs(List<Record>, optional). The native components the entity carries, each{ type, data }:typethe name the component answers to underecs(Mesh,Material,Light) anddataits row, as a saved record states it. A field that holds a mesh, a material or a texture holds a Geometry, a Material record, an asset reference or an asset's guid or identity, which spawning and exporting turn into the asset the component holds. Unwired, the entity carries none.position(List<Float>, default { 0, 0, 0 }). The entity's local position.rotation(List<Float>, default { 0, 0, 0, 1 }). The entity's local rotation as a quaternion (x, y, z, w).scale(List<Float>, default { 1, 1, 1 }). The entity's local scale.
Outputs
record(Record).{ name, original_id, parent_id, components, ecs, position, rotation, scale },parent_idpresent only whenparentis wired andecsonly whenecsis.
local lamp = g.prefab.record({ name = "lamp", id = "9", parent = "0", position = { 0, 2, 0 } })