Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AssetContainer

Container with a set of assets that can be added or removed from a scene.

Hierarchy

Index

Constructors

constructor

  • Instantiates an AssetContainer.

    Parameters

    • Optional scene: Nullable<Scene>

      The scene the AssetContainer belongs to.

    Returns AssetContainer

Properties

actionManagersSearch playground for actionManagers

actionManagers: AbstractActionManager[]

ActionManagers available on the scene.

deprecated

animationGroupsSearch playground for animationGroups

animationGroups: AnimationGroup[]

All of the animation groups added to this scene

see

https://doc.babylonjs.com/divingDeeper/animation/groupAnimations

animationsSearch playground for animations

animations: Animation[]

Gets a list of Animations associated with the scene

camerasSearch playground for cameras

cameras: Camera[]

All of the cameras added to this scene

see

https://doc.babylonjs.com/babylon101/cameras

effectLayersSearch playground for effectLayers

effectLayers: Array<EffectLayer>

The list of effect layers (highlights/glow) added to the scene

see

https://doc.babylonjs.com/how_to/highlight_layer

see

https://doc.babylonjs.com/how_to/glow_layer

geometriesSearch playground for geometries

geometries: Geometry[]

The list of geometries used in the scene.

layersSearch playground for layers

layers: Array<Layer>

The list of layers (background and foreground) of the scene

lensFlareSystemsSearch playground for lensFlareSystems

lensFlareSystems: Array<LensFlareSystem>

The list of lens flare system added to the scene

see

https://doc.babylonjs.com/how_to/how_to_use_lens_flares

lightsSearch playground for lights

lights: Light[]

All of the lights added to this scene

see

https://doc.babylonjs.com/babylon101/lights

materialsSearch playground for materials

materials: Material[]

All of the materials added to this scene In the context of a Scene, it is not supposed to be modified manually. Any addition or removal should be done using the addMaterial and removeMaterial Scene methods. Note also that the order of the Material within the array is not significant and might change.

see

https://doc.babylonjs.com/babylon101/materials

meshesSearch playground for meshes

meshes: AbstractMesh[]

All of the (abstract) meshes added to this scene

morphTargetManagersSearch playground for morphTargetManagers

morphTargetManagers: MorphTargetManager[]

The list of morph target managers added to the scene

see

https://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh

multiMaterialsSearch playground for multiMaterials

multiMaterials: MultiMaterial[]

All of the multi-materials added to this scene

see

https://doc.babylonjs.com/how_to/multi_materials

particleSystemsSearch playground for particleSystems

particleSystems: IParticleSystem[]

All of the particle systems added to this scene

see

https://doc.babylonjs.com/babylon101/particles

postProcessesSearch playground for postProcesses

postProcesses: PostProcess[]

The list of postprocesses added to the scene

prePassRendererSearch playground for prePassRenderer

prePassRenderer: Nullable<PrePassRenderer>

Gets or Sets the current prepass renderer associated to the scene.

proceduralTexturesSearch playground for proceduralTextures

proceduralTextures: Array<ProceduralTexture>

The list of procedural textures added to the scene

see

https://doc.babylonjs.com/how_to/how_to_use_procedural_textures

reflectionProbesSearch playground for reflectionProbes

reflectionProbes: Array<ReflectionProbe>

The list of reflection probes added to the scene

see

https://doc.babylonjs.com/how_to/how_to_use_reflection_probes

rootNodesSearch playground for rootNodes

rootNodes: Node[]

Gets the list of root nodes (ie. nodes with no parent)

sceneSearch playground for scene

scene: Scene

The scene the AssetContainer belongs to.

skeletonsSearch playground for skeletons

skeletons: Skeleton[]

The list of skeletons added to the scene

see

https://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons

soundsSearch playground for sounds

sounds: Nullable<Array<Sound>>

The list of sounds used in the scene.

subSurfaceConfigurationSearch playground for subSurfaceConfiguration

subSurfaceConfiguration: Nullable<SubSurfaceConfiguration>

Gets or Sets the current prepass renderer associated to the scene.

texturesSearch playground for textures

textures: BaseTexture[]

Textures to keep.

transformNodesSearch playground for transformNodes

transformNodes: TransformNode[]

All of the transform nodes added to this scene In the context of a Scene, it is not supposed to be modified manually. Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods. Note also that the order of the TransformNode within the array is not significant and might change.

see

https://doc.babylonjs.com/how_to/transformnode

Accessors

environmentTexture

  • Texture used in all pbr material as the reflection texture. As in the majority of the scene they are the same (exception for multi room and so on), this is easier to reference from here than from all the materials.

    Returns Nullable<BaseTexture>

  • Texture used in all pbr material as the reflection texture. As in the majority of the scene they are the same (exception for multi room and so on), this is easier to reference from here than from all the materials.

    Parameters

    Returns any

Methods

addAllToSceneSearch playground for addAllToScene

  • addAllToScene(): void
  • Adds all the assets from the container to the scene.

    Returns void

addEffectLayerSearch playground for addEffectLayer

  • Adds the given effect layer to this scene

    Parameters

    • newEffectLayer: EffectLayer

      defines the effect layer to add

    Returns void

addLensFlareSystemSearch playground for addLensFlareSystem

  • Adds the given lens flare system to this scene

    Parameters

    Returns void

addReflectionProbeSearch playground for addReflectionProbe

  • Adds the given reflection probe to this scene.

    Parameters

    Returns void

addToSceneSearch playground for addToScene

  • addToScene(predicate?: Nullable<(entity: any) => boolean>): void
  • Adds assets from the container to the scene.

    Parameters

    • Optional predicate: Nullable<(entity: any) => boolean>

      defines a predicate used to select which entity will be added (can be null)

    Returns void

createRootMeshSearch playground for createRootMesh

  • createRootMesh(): Mesh
  • Adds all meshes in the asset container to a root mesh that can be used to position all the contained meshes. The root mesh is then added to the front of the meshes in the assetContainer.

    Returns Mesh

    the root mesh

disablePrePassRendererSearch playground for disablePrePassRenderer

  • disablePrePassRenderer(): void

disableSubSurfaceForPrePassSearch playground for disableSubSurfaceForPrePass

  • disableSubSurfaceForPrePass(): void

disposeSearch playground for dispose

  • dispose(): void
  • Disposes all the assets in the container

    Returns void

enablePrePassRendererSearch playground for enablePrePassRenderer

enableSubSurfaceForPrePassSearch playground for enableSubSurfaceForPrePass

getGlowLayerByNameSearch playground for getGlowLayerByName

  • Return a the first highlight layer of the scene with a given name.

    Parameters

    • name: string

      The name of the highlight layer to look for.

    Returns Nullable<GlowLayer>

    The highlight layer if found otherwise null.

getHighlightLayerByNameSearch playground for getHighlightLayerByName

  • Return a the first highlight layer of the scene with a given name.

    Parameters

    • name: string

      The name of the highlight layer to look for.

    Returns Nullable<HighlightLayer>

    The highlight layer if found otherwise null.

getLensFlareSystemByIDSearch playground for getLensFlareSystemByID

  • Gets a lens flare system using its Id

    deprecated

    Please use getLensFlareSystemById instead

    Parameters

    • id: string

      defines the Id to look for

    Returns Nullable<LensFlareSystem>

    the lens flare system or null if not found

getLensFlareSystemByIdSearch playground for getLensFlareSystemById

getLensFlareSystemByNameSearch playground for getLensFlareSystemByName

getNodesSearch playground for getNodes

  • getNodes(): Array<Node>
  • Returns Array<Node>

    all meshes, lights, cameras, transformNodes and bones

instantiateModelsToSceneSearch playground for instantiateModelsToScene

  • instantiateModelsToScene(nameFunction?: (sourceName: string) => string, cloneMaterials?: boolean, options?: { doNotInstantiate: boolean; predicate?: (entity: any) => boolean }): InstantiatedEntries
  • Instantiate or clone all meshes and add the new ones to the scene. Skeletons and animation groups will all be cloned

    Parameters

    • Optional nameFunction: (sourceName: string) => string

      defines an optional function used to get new names for clones

        • (sourceName: string): string
        • Parameters

          • sourceName: string

          Returns string

    • Optional cloneMaterials: boolean

      defines an optional boolean that defines if materials must be cloned as well (false by default)

    • Optional options: { doNotInstantiate: boolean; predicate?: (entity: any) => boolean }

      defines an optional list of options to control how to instantiate / clone models

      • doNotInstantiate: boolean

        defines if the model must be instantiated or just cloned

      • Optional predicate?: (entity: any) => boolean

        defines a predicate used to filter whih mesh to instantiate/clone

          • (entity: any): boolean
          • Parameters

            • entity: any

            Returns boolean

    Returns InstantiatedEntries

    a list of rootNodes, skeletons and animation groups that were duplicated

mergeAnimationsToSearch playground for mergeAnimationsTo

  • Merge animations (direct and animation groups) from this asset container into a scene

    Parameters

    • scene: Nullable<Scene> | undefined

      is the instance of BABYLON.Scene to append to (default: last created scene)

    • animatables: Animatable[]

      set of animatables to retarget to a node from the scene

    • Optional targetConverter: Nullable<(target: any) => Nullable<Node>>

      defines a function used to convert animation targets from the asset container to the scene (default: search node by name)

    Returns AnimationGroup[]

    an array of the new AnimationGroup added to the scene (empty array if none)

moveAllFromSceneSearch playground for moveAllFromScene

  • Removes all the assets contained in the scene and adds them to the container.

    Parameters

    • Optional keepAssets: KeepAssets

      Set of assets to keep in the scene. (default: empty)

    Returns void

removeAllFromSceneSearch playground for removeAllFromScene

  • removeAllFromScene(): void
  • Removes all the assets in the container from the scene

    Returns void

removeEffectLayerSearch playground for removeEffectLayer

  • Removes the given effect layer from this scene.

    Parameters

    • toRemove: EffectLayer

      defines the effect layer to remove

    Returns number

    the index of the removed effect layer

removeFromSceneSearch playground for removeFromScene

  • removeFromScene(predicate?: Nullable<(entity: any) => boolean>): void
  • Removes assets in the container from the scene

    Parameters

    • Optional predicate: Nullable<(entity: any) => boolean>

      defines a predicate used to select which entity will be added (can be null)

    Returns void

removeLensFlareSystemSearch playground for removeLensFlareSystem

  • Removes the given lens flare system from this scene.

    Parameters

    Returns number

    The index of the removed lens flare system

removeReflectionProbeSearch playground for removeReflectionProbe

  • Removes the given reflection probe from this scene.

    Parameters

    Returns number

    The index of the removed reflection probe

Static AddIndividualParserSearch playground for AddIndividualParser

Static AddParserSearch playground for AddParser

  • Adds a parser in the list of available ones

    Parameters

    • name: string

      Defines the name of the parser

    • parser: BabylonFileParser

      Defines the parser to add

    Returns void

Static GetIndividualParserSearch playground for GetIndividualParser

Static GetParserSearch playground for GetParser

  • Gets a general parser from the list of available ones

    Parameters

    • name: string

      Defines the name of the parser

    Returns Nullable<BabylonFileParser>

    the requested parser or null

Static ParseSearch playground for Parse

  • Parser json data and populate both a scene and its associated container object

    Parameters

    • jsonData: any

      Defines the data to parse

    • scene: Scene

      Defines the scene to parse the data for

    • container: AssetContainer

      Defines the container attached to the parsing sequence

    • rootUrl: string

      Defines the root url of the data

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method