blenderproc.python.loader.ObjectLoader module

Provides load_obj, which allows to load different 3D object files.

blenderproc.python.loader.ObjectLoader.load_obj(filepath, cached_objects=None, use_legacy_obj_import=False, **kwargs)[source]

Import all objects for the given file and returns the loaded objects

In .obj files a list of objects can be saved in. In .ply files only one object can be saved so the list has always at most one element

Parameters:
  • filepath (str) – the filepath to the location where the data is stored

  • cached_objects (Optional[Dict[str, List[MeshObject]]]) – a dict of filepath to objects, which have been loaded before, to avoid reloading (the dict is updated in this function)

  • use_legacy_obj_import (bool) – If this is true the old legacy obj importer in python is used. It is slower, but it correctly imports the textures in the ShapeNet dataset.

  • kwargs – all other params are handed directly to the bpy loading fct. check the corresponding documentation

Return type:

List[MeshObject]

Returns:

The list of loaded mesh objects.