game.addModel

Adds models to the game's resources.

Prototype

  1. bOk = game.addModel ( hGame, hFile|sModelName )

Description

Adds models to the game module's resources tab. Only models that you plane to runtime-create have to be listed here, not the ones that are placed in scenes using the visual editor.


Parameters

hGame - valid Game handle
hFile|sModelName - valid file handle OR name of the model resource


Return values

bOk - true on success


Sample

  1. if ( hGame ) then
  2. for i = 1, #tFiles do
  3. if ( project.getFileType ( tFiles[i] ) == project.kFileTypeModel ) then
  4. game.addModel ( hGame, tFiles[i] )
  5. end
  6. end
  7. end

Available since ShiVa 2.0