Type alias StructureJson

StructureJson: { elements?: ElementDefinitions; file?: string; glTF?: Asset | string; grounds?: GroundDefinitions; lights?: LightDefinitions; parameterDeclaration?: ParameterDeclarations; parameters?: ParameterBag; scene?: string | SceneJson; setup?: string | SetupJson; variants?: { [id: string]: StructureJson } }

Type declaration

  • Optional elements?: ElementDefinitions
  • Optional file?: string
  • Optional glTF?: Asset | string
  • Optional grounds?: GroundDefinitions
  • Optional lights?: LightDefinitions
  • Optional parameterDeclaration?: ParameterDeclarations
  • Optional parameters?: ParameterBag
  • Optional scene?: string | SceneJson

    scene describes the visualisation of the babylon scene such as the incidence of light and camera position. If a string is given, the Viewer will resolve the URL or path and pass the parsed JSON to this property.

  • Optional setup?: string | SetupJson

    setup is a kind of construction plan for the Viewer. You can pass a SetupJson or a string, which must represent a valid URL or path. If a string is given, the Viewer will resolve the URL or path and pass the parsed JSON to this property. The SetupJson is responsible for managing a list of VariantInstanceDefinitions. These definitions define the instances that should be instantiated during the bootstrapping process. Each instance has a name and a reference to it's Variant.

  • Optional variants?: { [id: string]: StructureJson }

    variants is a declarative description of 3D-model variations in the configurator. Each variant itself is a StructureJson which must at least define a name in the key of the list and the properties glTF and elements in the value. FYI: Babylon.js's sandbox can show you the path of the 3D-model to properly define the paths.

    Example Code

    variants: {
    'My Pretty Variant' {
    glTF: {
    rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
    fileName: 'my_3d_model_file.glb',
    },
    elements: {
    'My Little Element': {
    paths: {
    includes: ['__root__.MeshName']
    }
    }
    }
    }
    }

    MeshName has to be identical to the path in the glb-file of the 3D-model.

Generated using TypeDoc