HomeWeb Components API Reference - v0.17.0
    Preparing search index...

    Type Alias HierarchyNode

    One node of the tree returned by ModelElement.hierarchy. A plain-data snapshot — JSON.stringify serializes it — whose toString() renders the node's subtree as a printable tree.

    type HierarchyNode = {
        children: HierarchyNode[];
        components: string[];
        index: number;
        materials: HierarchyMaterial[];
        name: string;
        path: string;
        toString(): string;
    }
    Index
    children: HierarchyNode[]

    The node's children.

    components: string[]

    The types of the components attached to the node (e.g. 'render'), sorted.

    index: number

    The node's position among identically named nodes in the model, counted in depth-first order over the whole tree: the match a pc-node's index attribute selects when name alone is ambiguous.

    materials: HierarchyMaterial[]

    The material assignments of the node's render component, one entry per mesh instance in component order. Empty for a node without a render component.

    name: string

    The node's name as instantiated, which is the name pc-node binding resolves: the engine parser synthesizes node_<index> names for unnamed nodes and renames identically named siblings apart (Wheel, Wheel1, ...), so it can differ from the name authored in the source asset.

    path: string

    The node's /-separated path below the model root — the path a pc-node bound to this node reports. The root's path is its own name.

    • Renders the subtree rooted at this node as a printable tree, one line per node: the name, [index] after a name that several nodes in the model share, the component types in parentheses, and the material names of a render component in braces.

      Returns string