blenderproc.python.types.EntityUtility module

class blenderproc.python.types.EntityUtility.Entity(bpy_object)[source]

Bases: blenderproc.python.types.StructUtility.Struct

apply_T(transform)[source]

Apply the given transformation to the pose of the entity.

Parameters:transform (Union[ndarray, Matrix]) – A 4x4 matrix representing the transformation.
delete()[source]

Deletes the entity

deselect()[source]

Deselects the entity.

get_local2world_mat()[source]

Returns the pose of the object in the form of a local2world matrix.

Return type:ndarray
Returns:The 4x4 local2world matrix.
get_location(frame=None)[source]

Returns the location of the entity in 3D world coordinates.

Parameters:frame (Optional[int]) – The frame number at which the value should be returned. If None is given, the current frame number is used.
Return type:ndarray
Returns:The location at the specified frame.
get_parent()[source]

Returns the parent of the entity.

Return type:Optional[Entity]
Returns:The parent.
get_rotation(frame=None)[source]

Returns the rotation of the entity in euler angles.

Parameters:frame (Optional[int]) – The frame number at which the value should be returned. If None is given, the current frame number is used.
Return type:ndarray
Returns:The rotation at the specified frame.
get_scale(frame=None)[source]

Returns the scale of the entity along all three axes.

Parameters:frame (Optional[int]) – The frame number at which the value should be returned. If None is given, the current frame number is used.
Return type:ndarray
Returns:The scale at the specified frame.
is_empty()[source]

Returns whether the entity is from type “EMPTY”.

Return type:bool
Returns:True, if its an empty.
select()[source]

Selects the entity.

set_local2world_mat(matrix_world)[source]

Sets the pose of the object in the form of a local2world matrix.

Parameters:matrix_world (Union[ndarray, Matrix]) – A 4x4 matrix.
set_location(location, frame=None)[source]

Sets the location of the entity in 3D world coordinates.

Parameters:
  • location (Union[list, Vector, ndarray]) – The location to set.
  • frame (Optional[int]) – The frame number which the value should be set to. If None is given, the current frame number is used.
set_parent(parent)[source]

Sets the parent of entity.

Parameters:parent (Entity) – The parent entity to set.
set_rotation_euler(rotation_euler, frame=None)[source]

Sets the rotation of the entity in euler angles.

Parameters:
  • rotation_euler (Union[list, Euler, ndarray]) – The euler angles to set.
  • frame (Optional[int]) – The frame number which the value should be set to. If None is given, the current frame number is used.
set_scale(scale, frame=None)[source]

Sets the scale of the entity along all three axes.

Parameters:
  • scale (Union[list, ndarray, Vector]) – The scale to set.
  • frame (Optional[int]) – The frame number which the value should be set to. If None is given, the current frame number is used.
update_blender_ref(name)[source]

Updates the contained blender reference using the given name of the instance.

Parameters:name (str) – The name of the instance which will be used to update its blender reference.
blenderproc.python.types.EntityUtility.convert_to_entities(blender_objects)[source]

Converts the given list of blender objects to entities

Parameters:blender_objects (list) – List of blender objects.
Return type:List[Entity]
Returns:The list of entities.
blenderproc.python.types.EntityUtility.create_empty(entity_name, empty_type='plain_axes')[source]

Creates an empty entity.

Parameters:
  • entity_name (str) – The name of the new entity.
  • empty_type (str) – Type of the newly created empty entity. Available: [“plain_axes”, “arrows”, “single_arrow”, “circle”, “cube”, “sphere”, “cone”]
Return type:

Entity

Returns:

The new Mesh entity.

blenderproc.python.types.EntityUtility.delete_multiple(entities)[source]

Deletes multiple entities at once

Parameters:entities (List[Entity]) – A list of entities that should be deleted