< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_model library

Description

gh_model is the module that manages models. A model node allows to define a 3d model. A model is a hierarchy of objects mainly made out of meshes. Some objects like gizmos (a very simple object node) may belong to this hierarchy to act as a pivot point on which more complex structures can be built. To keep it simple let's say a model is a kind of interface for easily modifying the properties of a number of meshes (children). GeeXLab can load directly many 3D models formats such as *.3ds, *.obj, *.glTF, *.x, etc.


Number of functions: 11

  1. gh_model.create_from_file ()
  2. gh_model.create_from_file_loader_3ds ()
  3. gh_model.create_from_file_loader_assimp ()
  4. gh_model.create_from_file_loader_assimp_v2 ()
  5. gh_model.create_from_file_loader_fbx ()
  6. gh_model.create_from_file_loader_gltf ()
  7. gh_model.create_from_file_loader_obj ()
  8. gh_model.create_from_file_loader_stl ()
  9. gh_model.create_from_zip_file_loader_assimp ()
  10. gh_model.load_textures ()
  11. gh_model.load_textures_from_zip ()



create_from_file

Description

Loads a 3d object filename and creates a model.


Syntax

model_id = gh_model.create_from_file(
 model_filename,
 model_directory,
 resource_directory
)

Languages


Parameters


Return Values


Code sample


model_filename = "wheel.3ds"
model_directory = "data/"
resource_directory = "data/"

model_id = gh_model.create_from_file(model_filename, model_directory, resource_directory)
			


create_from_file_loader_3ds

Description

Loads a *.3ds object filename and creates a model.


Syntax

model_id = gh_model.create_from_file_loader_3ds(
 model_filename,
 model_directory,
 resource_directory
)

Languages


Parameters


Return Values


Code sample


model_filename = "wheel.3ds"
model_directory = "data/"
resource_directory = "data/"

model_id = gh_model.create_from_file_loader_3ds(model_filename, model_directory, resource_directory)
			


create_from_file_loader_assimp

Description

Loads a 3D object filename using ASSIMP (many 3D formats are supported) plugin and creates a model.


Syntax

model_id = gh_model.create_from_file_loader_assimp(
 model_filename,
 model_directory,
 resource_directory
)

Languages


Parameters


Return Values


Code sample


model_filename = "wheel.stl"
model_directory = "data/"
resource_directory = "data/"

model_id = gh_model.create_from_file_loader_assimp(model_filename, model_directory, resource_directory)
			


create_from_file_loader_assimp_v2

Description

Loads a 3D object filename using ASSIMP (many 3D formats are supported) plugin and creates a model.


Syntax

model_id = gh_model.create_from_file_loader_assimp_v2(
 model_filename,
 model_directory,
 resource_directory,
 pp_options
)

Languages


Parameters


Return Values


Code sample


model_filename = "wheel.stl"
model_directory = "data/"
resource_directory = "data/"

pp_options = ""

model_id = gh_model.create_from_file_loader_assimp_v2(model_filename, model_directory, resource_directory, pp_options)
			


create_from_file_loader_fbx

Description

Loads a *.fbx, *.3ds or *.obj object filename and creates a model.


Syntax

model_id = gh_model.create_from_file_loader_fbx(
 model_filename,
 model_directory,
 resource_directory
)

Languages


Parameters


Return Values


Code sample


model_filename = "wheel.fbx"
model_directory = "data/"
resource_directory = "data/"

model_id = gh_model.create_from_file_loader_fbx(model_filename, model_directory, resource_directory)
			


create_from_file_loader_gltf

Description

Loads a *.gltf object filename and creates a model.


Syntax

model_id = gh_model.create_from_file_loader_gltf(
 model_filename,
 model_directory,
 resource_directory
)

Languages


Parameters


Return Values


Code sample


model_filename = "scene.gltf"
model_directory = "data/"
resource_directory = "data/"

model_id = gh_model.create_from_file_loader_gltf(model_filename, model_directory, resource_directory)
			


create_from_file_loader_obj

Description

Loads a *.obj object filename and creates a model.


Syntax

model_id = gh_model.create_from_file_loader_obj(
 model_filename,
 model_directory,
 resource_directory
)

Languages


Parameters


Return Values


Code sample


model_filename = "wheel.obj"
model_directory = "data/"
resource_directory = "data/"

model_id = gh_model.create_from_file_loader_obj(model_filename, model_directory, resource_directory)
			


create_from_file_loader_stl

Description

Loads a binary *.stl object filename and creates a model.


Syntax

model_id = gh_model.create_from_file_loader_stl(
 model_filename,
 model_directory,
 resource_directory
)

Languages


Parameters


Return Values


Code sample


model_filename = "wheel.stl"
model_directory = "data/"
resource_directory = "data/"

model_id = gh_model.create_from_file_loader_stl(model_filename, model_directory, resource_directory)
			


create_from_zip_file_loader_assimp

Description

Loads a 3D object file using ASSIMP plugin (many 3D formats are supported) from a zip archive and creates a model.


Syntax

model_id = gh_model.create_from_zip_file_loader_assimp(
 zip_filename,
 model_filename,
 model_directory,
 resource_directory,
 pp_options
)

Languages


Parameters


Return Values


Code sample


zip_filename = gh_utils.get_demo_dir() .. "demo.zip"
model_filename = "wheel.stl"
model_directory = "data/"
resource_directory = "data/"

pp_options = ""

model_id = gh_model.create_from_zip_file_loader_assimp(zip_filename, model_filename, model_directory, resource_directory, pp_options)
			


load_textures

Description

Loads all textures associated with the model. Once the model is loaded, you can load all textures using this function.


Syntax

num_textures = gh_model.load_textures(
 model_id,
 texture_directory
)

Languages


Parameters


Return Values


Code sample


num_textures = gh_model.load_textures(model_id, "data/")
			


load_textures_from_zip

Description

Loads all textures associated with the model from a zip file. Once the model is loaded, you can load all textures using this function.


Syntax

num_textures = gh_model.load_textures_from_zip(
 model_id,
 zip_filename,
 texture_directory
)

Languages


Parameters


Return Values


Code sample


num_textures = gh_model.load_textures_from_zip(model_id, zip_filename, "data/")
			






GeeXLab Rootard Guide | Downloads | Contact | Newsletter