Documentation
    Preparing search index...

    Function instantiateScene

    • Rebuilds the single-root scene held by document.

      The returned node is the class the document names — a Scene for "scene", a Group for "group", whatever InstantiateSceneOptions.nodeFactory returns otherwise — so a document written by serializeScene reloads as the same class it was saved from.

      A document with several roots is refused rather than silently reduced to its first: use instantiateSceneNodes, which returns all of them.

      Parameters

      Returns Node

      the root node, with its subtree attached

      FourError INVALID_SCENE_GRAPH if the document does not hold exactly one root, or names a node type this build has no class for