active_object
active_object(context=None)Return the active object, raising an error if there is none.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| context | bpy.types.Context | None |
The context to read the active object from. Defaults to bpy.context. |
None |
Returns
| Name | Type | Description |
|---|---|---|
bpy.types.Object |
The active object. |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If the context has no active object. |