Skip to content

LoadMesh

Claude edited this page Oct 28, 2026 · 11 revisions
Blitz3D

LoadMesh

LoadMesh:Int32 file:String, parent:Int32=0
Parameter Type Default Description
file String required Path of the model file.
parent Int32 0 Entity the mesh follows, or 0 for none. Defaults to 0.

Returns: The handle of the mesh, or 0 if the file could not be loaded.

Description

Loads a model from a file as one mesh entity. Any hierarchy and animation in the file is thrown away and the whole model is merged into a single mesh, which is what you want for scenery and props. The original reads .b3d, .x and .3ds, and so does this; the file type is told by what is in the file, not by its name. Parts of the model that are painted the same (the same colors, picture and so on) share a surface, the parts below a part are put in before it, and a normal of a scaled part is scaled by the square of that, as in the original. The mesh is made at the origin even with a parent. If the file cannot be found the result is 0, so check it.

Use LoadAnimMesh when the model has bones or parts that need to move on their own.

Differences

  • Models in .b3d, .3ds and DirectX .x files (text, binary and compressed) can be loaded; the other file types of the original do not exist. The DirectX loader is described in DirectX models and the 3D Studio loader in 3D Studio models.

Related Commands

AddMesh, CopyMesh, CreateMesh, FitMesh, FlipMesh, LoadAnimMesh, PaintMesh, PositionMesh

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

Clone this wiki locally