Uses#
The uses placed in a scene or under a parent use (scene.objects, scene.roots, use.children): look up by ID or unambiguous name, iterate in hierarchy order, and add(obj) another use.
class Uses(Collection)Inherits Collection: its members are documented there.
Usage and examples
Members: add
add#
add(obj: Object, *, name: str | None=None) -> UseAdds a use of existing object data and returns its scene-scoped handle. name is an optional use label. Scene collections add roots; children.add changes the parent's shared object composition, so every use of that parent gains the child. Creation preserves UI selection and Inspector.
name is a display label, not an identity: the use's id is generated (a child's is its parent's ID, a slash and a slug of the child object's name, such as player/camera), and later lookups by name (scene.objects["Left"]) work only while the label is unique. At runtime a script reaches a part of its own object by that label with Entity.Child("camera"), and another placed object through a SceneReference field assigned the use, never by building an ID (see how a script reaches other objects).
Related types#
Collection · ComponentProperties · Object · Scene · Use
Source#
- _live.py:1020