Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OBJFileLoader

OBJ file type loader. This is a babylon scene loader plugin.

Hierarchy

  • OBJFileLoader

Implements

Index

Constructors

constructor

  • Creates loader for .OBJ files

    Parameters

    • Optional loadingOptions: OBJLoadingOptions

      options for loading and parsing OBJ/MTL files.

    Returns OBJFileLoader

Properties

extensionsSearch playground for extensions

extensions: string

Defines the extension the plugin is able to load.

nameSearch playground for name

name: string

Defines the name of the plugin.

Static COMPUTE_NORMALSSearch playground for COMPUTE_NORMALS

COMPUTE_NORMALS: boolean

Compute the normals for the model, even if normals are present in the file.

Static IMPORT_VERTEX_COLORSSearch playground for IMPORT_VERTEX_COLORS

IMPORT_VERTEX_COLORS: boolean

Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.

Static INVERT_YSearch playground for INVERT_Y

INVERT_Y: boolean

Invert model on y-axis (does a model scaling inversion)

Static MATERIAL_LOADING_FAILS_SILENTLYSearch playground for MATERIAL_LOADING_FAILS_SILENTLY

MATERIAL_LOADING_FAILS_SILENTLY: boolean

When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.

Defaults to true for backwards compatibility.

Static OPTIMIZE_NORMALSSearch playground for OPTIMIZE_NORMALS

OPTIMIZE_NORMALS: boolean

Optimize the normals for the model. Lighting can be uneven if you use OptimizeWithUV = true because new vertices can be created for the same location if they pertain to different faces. Using OptimizehNormals = true will help smoothing the lighting by averaging the normals of those vertices.

Static OPTIMIZE_WITH_UVSearch playground for OPTIMIZE_WITH_UV

OPTIMIZE_WITH_UV: boolean

Defines if UVs are optimized by default during load.

Static SKIP_MATERIALSSearch playground for SKIP_MATERIALS

SKIP_MATERIALS: boolean

Skip loading the materials even if defined in the OBJ file (materials are ignored).

Static UV_SCALINGSearch playground for UV_SCALING

UV_SCALING: Vector2

Defines custom scaling of UV coordinates of loaded meshes.

Accessors

Static INVERT_TEXTURE_Y

  • get INVERT_TEXTURE_Y(): boolean
  • set INVERT_TEXTURE_Y(value: boolean): any
  • Invert Y-Axis of referenced textures on load

    Returns boolean

  • Invert Y-Axis of referenced textures on load

    Parameters

    • value: boolean

    Returns any

Methods

canDirectLoadSearch playground for canDirectLoad

  • canDirectLoad(): boolean
  • If the data string can be loaded directly.

    Returns boolean

    if the data can be loaded directly

createPluginSearch playground for createPlugin

importMeshAsyncSearch playground for importMeshAsync

  • Imports one or more meshes from the loaded OBJ data and adds them to the scene

    Parameters

    • meshesNames: any

      a string or array of strings of the mesh names that should be loaded from the file

    • scene: Scene

      the scene the meshes should be added to

    • data: any

      the OBJ data to load

    • rootUrl: string

      root url to load from

    Returns Promise<ISceneLoaderAsyncResult>

    a promise containing the loaded meshes, particles, skeletons and animations

loadAssetContainerAsyncSearch playground for loadAssetContainerAsync

  • loadAssetContainerAsync(scene: Scene, data: string, rootUrl: string): Promise<AssetContainer>
  • Load into an asset container.

    Parameters

    • scene: Scene

      The scene to load into

    • data: string

      The data to import

    • rootUrl: string

      The root url for scene and resources

    Returns Promise<AssetContainer>

    The loaded asset container

loadAsyncSearch playground for loadAsync

  • loadAsync(scene: Scene, data: string, rootUrl: string): Promise<void>
  • Imports all objects from the loaded OBJ data and adds them to the scene

    Parameters

    • scene: Scene

      the scene the objects should be added to

    • data: string

      the OBJ data to load

    • rootUrl: string

      root url to load from

    Returns Promise<void>

    a promise which completes when objects have been loaded to the scene

Legend

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