Skip to Content

Object

Inherits from: _Serializable

Methods

set_location

Description:

Set the location of the object in 3D space.

Signature:

def set_location(self, location: Union[mathutils.Vector, typing.Sequence[float]])

Arguments:

  • location : Union[mathutils.Vector, typing.Sequence[float]]

Returns: Self


set_rotation

Description:

Set the rotation of the object.

Signature:

def set_rotation(self, rotation: Union[mathutils.Euler, mathutils.Quaternion])

Arguments:

  • rotation : Union[mathutils.Euler, mathutils.Quaternion]

Returns: Self


set_scale

Description:

Set the scale of the object.

If scale is a single float, all axes are set to that value. If scale is a sequence or Vector of length 3, each axis is set individually.

Signature:

def set_scale(self, scale: Union[mathutils.Vector, typing.Sequence[float], float])

Arguments:

  • scale : Union[mathutils.Vector, typing.Sequence[float], float]

Returns: Self


set_property

Description:

Set a property of the object. Properties can be used inside object’s material nodes.

Signature:

def set_property(self, key: str, value: any)

Arguments:

  • key : str
  • value : any

Returns: Self


set_tags

Description:

Set object’s tags.

Tags are used to represent object class for training a computer vision model. Object can have more then one tag.

Signature:

def set_tags(self, *tags: str | list[str])

Arguments:

  • *tags : str | list[str]

Returns: Self


add_tags

Description:

Add tags to the object.

Tags are used to represent object class for training a computer vision model. Object can have more then one tag.

Signature:

def add_tags(self, *tags: str | list[str])

Arguments:

  • *tags : str | list[str]

Returns: Self


point_at

Description:

Orients the current object to point at another object, with an optional rotation around the direction vector.

Signature:

def point_at(self, rv_obj: 'Object', angle: float=0.0)

Arguments:

  • rv_obj : 'Object' — Object to point at

  • angle : float — Angle to rotate around the direction vector in degrees

Returns: Self


rotate_around_axis

Description:

Rotate object around an axis.

Signature:

def rotate_around_axis(self, axis: mathutils.Vector, angle: float)

Arguments:

  • axis : mathutils.Vector — Axis of rotation

  • angle : float — Angle of rotation in degrees

Returns: Self


set_shading

Description:

Set shading to flat or smooth.

Signature:

def set_shading(self, shading: Literal['flat', 'smooth'])

Arguments:

  • shading : Literal['flat', 'smooth']

Returns: Self


show_debug_axes

Description:

Show debug axes that can be seen in the preview mode.

Signature:

def show_debug_axes(self, show=True)

Arguments:

  • show

Returns: Self


show_debug_name

Description:

Show object’s name that can be seen in the preview mode.

Signature:

def show_debug_name(self, show)

Arguments:

  • show

Returns: Self


Attributes

obj

Type: bpy.types.Object


scene

Type: Scene


tags

Type: set[str]


properties

Type: dict


index

Type: int


Last updated on