Documentation
    Preparing search index...

    Interface InstantiateSceneOptions

    interface InstantiateSceneOptions {
        nodeFactory?: (document: SceneNodeDocument) => Node | undefined;
        unknownComponents?: UnknownComponentPolicy;
    }
    Index
    nodeFactory?: (document: SceneNodeDocument) => Node | undefined

    Constructs a node for a document this package has no class for — the counterpart of SerializeSceneOptions.nodeTypeOf. Returning undefined falls back to the built-in "scene" / "group" types, and a document type with neither is a FourError.

    The returned node's transform, flags, tags, metadata, components, and children are applied afterwards by the instantiator; the factory only has to produce the right class.

    unknownComponents?: UnknownComponentPolicy

    What to do with a component whose type has no registered serializer.

    "throw" (the default) refuses the load: an unknown component is unsaved state, and continuing would hand the application a scene that is quietly missing behavior. "skip" drops it — the right choice for a viewer or an inspector that only needs the hierarchy, and the reason the choice is the caller's rather than this package's.

    Note that the document preserves unknown component data either way (§79: "capable of preserving unknown extension data"): validation keeps every component entry whatever its type, so decode → encode round-trips data this build cannot instantiate. Only the live scene loses it.