blenderproc.python.loader.IKEALoader module

class blenderproc.python.loader.IKEALoader.IKEALoader[source]

Bases: object

This class loads objects from the IKEA dataset.

Objects can be selected randomly, based on object type, object style, or both.

static _check_material_file(path)[source]

Checks whether there is a texture file (.mtl) associated to the object available.

Parameters:path (str) – path to object
Return type:bool
Returns:texture file exists
static _generate_object_dict(data_dir)[source]

Generates a dictionary of all available objects, i.e. all .obj files that have an associated .mtl file.

Parameters:data_dir (str) – The directory with all the IKEA models.
Return type:dict
Returns:dict: {IKEA_<type>_<style> : [<path_to_obj_file>, …]}
static _get_object_by_style(obj_style, obj_dict)[source]

Finds all available objects with a specific style, i.e. IKEA product series.

Parameters:obj_type – (str) type of object e.g. ‘table’
Returns:(list) list of available objects with specified style
static _get_object_by_type(obj_type, obj_dict)[source]

Finds all available objects with a specific type.

Parameters:obj_type (str) – type of object e.g. ‘table’
Return type:list
Returns:list of available objects with specified type
blenderproc.python.loader.IKEALoader.load_ikea(data_dir='resources/IKEA', obj_categories=None, obj_style=None)[source]

Loads ikea objects based on selected type and style.

If there are multiple options it picks one randomly or if style or type is None it picks one randomly.

Parameters:
  • data_dir (str) – The directory with all the IKEA models.
  • obj_categories (Union[list, str, None]) – The category to use for example: ‘bookcase’. This can also be a list of elements. Available: [‘bed’, ‘bookcase’, ‘chair’, ‘desk’, ‘sofa’, ‘table’, ‘wardrobe’]
  • obj_style (Optional[str]) – The IKEA style to use for example: ‘hemnes’. See data_dir for other options.
Return type:

List[MeshObject]

Returns:

The list of loaded mesh objects.