< 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: 10

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



create_from_file

Description

Loads a 3d object filename and creates a model.


Syntax

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

Languages

Lua - Python


Parameters


Return Values


Code sample


model_filename = "wheel.3ds"
model_directory = "data/"
resource_directory = "data/"
model = 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 = gh_model.create_from_file_loader_3ds(
 model_filename,
 model_directory,
 resource_directory
)

Languages

Lua - Python


Parameters


Return Values


Code sample


model_filename = "wheel.3ds"
model_directory = "data/"
resource_directory = "data/"
model = gh_model.create_from_file_loader_3ds(model_filename, model_directory, resource_directory)
            


create_from_file_loader_fbx

Description

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


Syntax

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

Languages

Lua - Python


Parameters


Return Values


Code sample


model_filename = "wheel.fbx"
model_directory = "data/"
resource_directory = "data/"
model = gh_model.create_from_file_loader_fbx(model_filename, model_directory, resource_directory)
            


create_from_file_loader_obj

Description

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


Syntax

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

Languages

Lua - Python


Parameters


Return Values


Code sample


model_filename = "wheel.obj"
model_directory = "data/"
resource_directory = "data/"
model = 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 = gh_model.create_from_file_loader_stl(
 model_filename,
 model_directory,
 resource_directory
)

Languages

Lua - Python


Parameters


Return Values


Code sample


model_filename = "wheel.stl"
model_directory = "data/"
resource_directory = "data/"
model = gh_model.create_from_file_loader_stl(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 = gh_model.create_from_file_loader_assimp(
 model_filename,
 model_directory,
 resource_directory
)

Languages

Lua - Python


Parameters


Return Values


Code sample


model_filename = "wheel.stl"
model_directory = "data/"
resource_directory = "data/"
model = 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 = gh_model.create_from_file_loader_assimp_v2(
 model_filename,
 model_directory,
 resource_directory,
 pp_options
)

Languages

Lua - Python


Parameters


Return Values


Code sample


model_filename = "wheel.stl"
model_directory = "data/"
resource_directory = "data/"
pp_options = ""
model = gh_model.create_from_file_loader_assimp_v2(model_filename, model_directory, resource_directory, pp_options)
            


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 = gh_model.create_from_zip_file_loader_assimp(
 zip_filename,
 model_filename,
 model_directory,
 resource_directory,
 pp_options
)

Languages

Lua - Python


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 = 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,
 texture_directory
)

Languages

Lua - Python


Parameters


Return Values


Code sample


num_textures = gh_model.load_textures(model, "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,
 zip_filename,
 texture_directory
)

Languages

Lua - Python


Parameters


Return Values


Code sample


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






GeeXLab Rootard Guide | Downloads | Contact | Newsletter