blenderproc.python.loader.IKEALoader module
Loads all ikea objects, beware that the ikea objects can no longer be downloaded.
- 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
[str
,List
[str
]]- 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_style (
str
) – Style of the objectobj_dict (
Dict
[str
,List
[str
]]) – mapping of the style and type to the path {IKEA_<type>_<style> : [<path_to_obj_file>, …]}
- Return type:
List
[str
]- 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’obj_dict (
Dict
[str
,List
[str
]]) – mapping of the style and type to the path {IKEA_<type>_<style> : [<path_to_obj_file>, …]}
- Return type:
List
[str
]- 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
],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.