user: What is Basic Object Operations Example and how is it used in Blender Python scripting?

assistant:  data-block. To force free it, use to_curve_clear(). The result is temporary and cannot be used by objects from the main database.

        Parameters:
        :   - **depsgraph** ([`Depsgraph`](bpy.types.Depsgraph.html#bpy.types.Depsgraph "bpy.types.Depsgraph")) – Dependency Graph, Evaluated dependency graph
            - **apply_modifiers** (*boolean**,* *(**optional**)*) – Apply the deform modifiers on the control points of the curve. This is only supported for curve objects.

        Returns:
        :   Curve created from object

        Return type:
        :   [`Curve`](bpy.types.Curve.html#bpy.types.Curve "bpy.types.Curve")

    to_curve_clear()
    :   Clears curve data-block created by to_curve()

    find_armature()
    :   Find armature influencing this object as a parent or via a modifier

        Returns:
        :   Armature object influencing this object or nullptr

        Return type:
        :   [`Object`](#bpy.types.Object "bpy.types.Object")

    shape_key_add(*\**, *name='Key'*, *from_mix=True*)
    :   Add shape key to this object

        Parameters:
        :   - **name** (*string**,* *(**optional**,* *never None**)*) – Unique name for the new key-block
            - **from_mix** (*boolean**,* *(**optional**)*) – Create new shape from existing mix of shapes

        Returns:
        :   New shape key-block

        Return type:
        :   [`ShapeKey`](bpy.types.ShapeKey.html#bpy.types.ShapeKey "bpy.types.ShapeKey")

    shape_key_remove(*key*)
    :   Remove a Shape Key from this object

        Parameters:
        :   **key** ([`ShapeKey`](bpy.types.ShapeKey.html#bpy.types.ShapeKey "bpy.types.ShapeKey"), (never None)) – Key-block to be removed

    shape_key_clear()
    :   Remove all Shape Keys from this object

    ray_cast(*origin*, *direction*, *\**, *distance=1.70141e+38*, *depsgraph=None*)
    :   Cast a ray onto evaluated geometry, in object space (using context’s or provided depsgraph to get evaluated mesh if needed)

        Parameters:
        :   - **origin** ([`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf]) – Origin of the ray, in object space
            - **direction** ([`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf]) – Direction of the ray, in object space
            - **distance** (*float in* *[**0**,* *inf**]**,* *(**optional**)*) – Maximum distance
            - **depsgraph** ([`Depsgraph`](bpy.types.Depsgraph.html#bpy.types.Depsgraph "bpy.types.Depsgraph"), (optional)) – Depsgraph to use to get evaluated data, when called from original object (only needed if current Context’s depsgraph is not suitable)

        Returns:
        :   `result`, Whether the ray successfully hit the geometry, boolean

            `location`, The hit location of this ray cast, [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf]

            `normal`, The face normal at the ray cast hit location, [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf]

            `index`, The face index, -1 when original data isn’t available, int in [-inf, inf]

        Return type:
        :   (boolean, [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf], [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf], int in [-inf, inf])

    closest_point_on_mesh(*origin*, *\**, *distance=1.84467e+19*, *depsgraph=None*)
    :   Find the nearest point on evaluated geometry, in object space (using context’s or provided depsgraph to get evaluated mesh if needed)

        Parameters:
        :   - **origin** ([`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf]) – Point to find closest geometry from (in object space)
            - **distance** (*float in* *[**0**,* *inf**]**,* *(**optional**)*) – Maximum distance
            - **depsgraph** ([`Depsgraph`](bpy.types.Depsgraph.html#bpy.types.Depsgraph "bpy.types.Depsgraph"), (optional)) – Depsgraph to use to get evaluated data, when called from original object (only needed if current Context’s depsgraph is not suitable)

        Returns:
        :   `result`, Whether closest point on geometry was found, boolean

            `location`, The location on the object closest to the point, [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf]

            `normal`, The face normal at the closest point, [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf]

            `index`, The face index, -1 when original data isn’t available, int in [-inf, inf]

        Return type:
        :   (boolean, [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf], [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 3 items in [-inf, inf], int in [-inf, inf])

    is_modified(*scene*, *settings*)
    :   Determine if this object is modified from the base mesh data

        Parameters:
        :   - **scene** ([`Scene`](bpy.types.Scene.html#bpy.types.Scene "bpy.types.Scene"), (never None)) – Scene in which to check the object
            - **settings** (enum in [`'PREVIEW'`, `'RENDER'`]) –

              Modifier settings to apply

              - `PREVIEW`
                Preview – Apply modifier preview settings.
              - `RENDER`
                Render – Apply modifier render settings.

        Returns:
        :   Whether the object is modified

        Return type:
        :   boolean

    is_deform_modified(*scene*, *settings*)
    :   Determine if this object is modified by a deformation from the base mesh data

        Parameters:
        :   - **scene** ([`Scene`](bpy.types.Scene.html#bpy.types.Scene "bpy.types.Scene"), (never None)) – Scene in which to check the object
            - **settings** (enum in [`'PREVIEW'`, `'RENDER'`]) –

              Modifier settings to apply

              - `PREVIEW`
                Preview – Apply modifier preview settings.
              - `RENDER`
                Render – Apply modifier render settings.

        Returns:
        :   Whether the object is deform-modified

        Return type:
        :   boolean

    update_from_editmode()
    :   Load the objects edit-mode data into the object data

        Returns:
        :   Success

        Return type:
        :   boolean

    cache_release()
    :   Release memory used by caches associated with this object. Intended to be used by render engines only.

    evaluated_geometry()
    :   Get the evaluated geometry set of this evaluated object. This only works for
        objects that contain geometry data like meshes and curves but not e.g. cameras.

        Returns:
        :   The evaluated geometry.

        Return type:
        :   [`bpy.types.GeometrySet`](bpy.types.GeometrySet.html#bpy.types.GeometrySet "bpy.types.GeometrySet")

    *classmethod* bl_rna_get_subclass(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The RNA type or default when not found.

        Return type:
        :   [`bpy.types.Struct`](bpy.types.Struct.html#bpy.types.Struct "bpy.types.Struct") subclass

    *classmethod* bl_rna_get_subclass_py(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The class or default when not found.

        Return type:
        :   [type](#bpy.types.Object.type "bpy.types.Object.type")

### Inherited Properties

|  |  |
| --- | --- |
| - [`bpy_struct.id_data`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.id_data "bpy.types.bpy_struct.id_data") - [`ID.name`](bpy.types.ID.html#bpy.types.ID.name "bpy.types.ID.name") - [`ID.name_full`](bpy.types.ID.html#bpy.types.ID.name_full "bpy.types.ID.name_full") - [`ID.id_type`](bpy.types.ID.html#bpy.types.ID.id_type "bpy.types.ID.id_type") - [`ID.session_uid`](bpy.types.ID.html#bpy.types.ID.session_uid "bpy.types.ID.session_uid") - [`ID.is_evaluated`](bpy.types.ID.html#bpy.types.ID.is_evaluated "bpy.types.ID.is_evaluated") - [`ID.original`](bpy.types.ID.html#bpy.types.ID.original "bpy.types.ID.original") - [`ID.users`](bpy.types.ID.html#bpy.types.ID.users "bpy.types.ID.users") - [`ID.use_fake_user`](bpy.types.ID.html#bpy.types.ID.use_fake_user "bpy.types.ID.use_fake_user") - [`ID.use_extra_user`](bpy.types.ID.html#bpy.types.ID.use_extra_user "bpy.types.ID.use_extra_user") - [`ID.is_embedded_data`](bpy.types.ID.html#bpy.types.ID.is_embedded_data "bpy.types.ID.is_embedded_data") | - [`ID.is_linked_packed`](bpy.types.ID.html#bpy.types.ID.is_linked_packed "bpy.types.ID.is_linked_packed") - [`ID.is_missing`](bpy.types.ID.html#bpy.types.ID.is_missing "bpy.types.ID.is_missing") - [`ID.is_runtime_data`](bpy.types.ID.html#bpy.types.ID.is_runtime_data "bpy.types.ID.is_runtime_data") - [`ID.is_editable`](bpy.types.ID.html#bpy.types.ID.is_editable "bpy.types.ID.is_editable") - [`ID.tag`](bpy.types.ID.html#bpy.types.ID.tag "bpy.types.ID.tag") - [`ID.is_library_indirect`](bpy.types.ID.html#bpy.types.ID.is_library_indirect "bpy.types.ID.is_library_indirect") - [`ID.library`](bpy.types.ID.html#bpy.types.ID.library "bpy.types.ID.library") - [`ID.library_weak_reference`](bpy.types.ID.html#bpy.types.ID.library_weak_reference "bpy.types.ID.library_weak_reference") - [`ID.asset_data`](bpy.types.ID.html#bpy.types.ID.asset_data "bpy.types.ID.asset_data") - [`ID.override_library`](bpy.types.ID.html#bpy.types.ID.override_library "bpy.types.ID.override_library") - [`ID.preview`](bpy.types.ID.html#bpy.types.ID.preview "bpy.types.ID.preview") |

### Inherited Functions

|  |  |
| --- | --- |
| - [`bpy_struct.as_pointer`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.as_pointer "bpy.types.bpy_struct.as_pointer") - [`bpy_struct.driver_add`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.driver_add "bpy.types.bpy_struct.driver_add") - [`bpy_struct.driver_remove`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.driver_remove "bpy.types.bpy_struct.driver_remove") - [`bpy_struct.get`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.get "bpy.types.bpy_struct.get") - [`bpy_struct.id_properties_clear`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.id_properties_clear "bpy.types.bpy_struct.id_properties_clear") - [`bpy_struct.id_properties_ensure`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.id_properties_ensure "bpy.types.bpy_struct.id_properties_ensure") - [`bpy_struct.id_properties_ui`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.id_properties_ui "bpy.types.bpy_struct.id_properties_ui") - [`bpy_struct.is_property_hidden`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.is_property_hidden "bpy.types.bpy_struct.is_property_hidden") - [`bpy_struct.is_property_overridable_library`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.is_property_overridable_library "bpy.types.bpy_struct.is_property_overridable_library") - [`bpy_struct.is_property_readonly`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.is_property_readonly "bpy.types.bpy_struct.is_property_readonly") - [`bpy_struct.is_property_set`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.is_property_set "bpy.types.bpy_struct.is_property_set") - [`bpy_struct.items`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.items "bpy.types.bpy_struct.items") - [`bpy_struct.keyframe_delete`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.keyframe_delete "bpy.types.bpy_struct.keyframe_delete") - [`bpy_struct.keyframe_insert`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.keyframe_insert "bpy.types.bpy_struct.keyframe_insert") - [`bpy_struct.keys`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.keys "bpy.types.bpy_struct.keys") - [`bpy_struct.path_from_id`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.path_from_id "bpy.types.bpy_struct.path_from_id") - [`bpy_struct.path_from_module`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.path_from_module "bpy.types.bpy_struct.path_from_module") - [`bpy_struct.path_resolve`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.path_resolve "bpy.types.bpy_struct.path_resolve") - [`bpy_struct.pop`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.pop "bpy.types.bpy_struct.pop") - [`bpy_struct.property_overridable_library_set`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.property_overridable_library_set "bpy.types.bpy_struct.property_overridable_library_set") - [`bpy_struct.property_unset`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.property_unset "bpy.types.bpy_struct.property_unset") - [`bpy_struct.rna_ancestors`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.rna_ancestors "bpy.types.bpy_struct.rna_ancestors") | - [`bpy_struct.type_recast`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.type_recast "bpy.types.bpy_struct.type_recast") - [`bpy_struct.values`](bpy.types.bpy_struct.html#bpy.types.bpy_struct.values "bpy.types.bpy_struct.values") - [`ID.bl_system_properties_get`](bpy.types.ID.html#bpy.types.ID.bl_system_properties_get "bpy.types.ID.bl_system_properties_get") - [`ID.rename`](bpy.types.ID.html#bpy.types.ID.rename "bpy.types.ID.rename") - [`ID.evaluated_get`](bpy.types.ID.html#bpy.types.ID.evaluated_get "bpy.types.ID.evaluated_get") - [`ID.copy`](bpy.types.ID.html#bpy.types.ID.copy "bpy.types.ID.copy") - [`ID.asset_mark`](bpy.types.ID.html#bpy.types.ID.asset_mark "bpy.types.ID.asset_mark") - [`ID.asset_clear`](bpy.types.ID.html#bpy.types.ID.asset_clear "bpy.types.ID.asset_clear") - [`ID.asset_generate_preview`](bpy.types.ID.html#bpy.types.ID.asset_generate_preview "bpy.types.ID.asset_generate_preview") - [`ID.override_create`](bpy.types.ID.html#bpy.types.ID.override_create "bpy.types.ID.override_create") - [`ID.override_hierarchy_create`](bpy.types.ID.html#bpy.types.ID.override_hierarchy_create "bpy.types.ID.override_hierarchy_create") - [`ID.user_clear`](bpy.types.ID.html#bpy.types.ID.user_clear "bpy.types.ID.user_clear") - [`ID.user_remap`](bpy.types.ID.html#bpy.types.ID.user_remap "bpy.types.ID.user_remap") - [`ID.make_local`](bpy.types.ID.html#bpy.types.ID.make_local "bpy.types.ID.make_local") - [`ID.user_of_id`](bpy.types.ID.html#bpy.types.ID.user_of_id "bpy.types.ID.user_of_id") - [`ID.animation_data_create`](bpy.types.ID.html#bpy.types.ID.animation_data_create "bpy.types.ID.animation_data_create") - [`ID.animation_data_clear`](bpy.types.ID.html#bpy.types.ID.animation_data_clear "bpy.types.ID.animation_data_clear") - [`ID.update_tag`](bpy.types.ID.html#bpy.types.ID.update_tag "bpy.types.ID.update_tag") - [`ID.preview_ensure`](bpy.types.ID.html#bpy.types.ID.preview_ensure "bpy.types.ID.preview_ensure") - [`ID.bl_rna_get_subclass`](bpy.types.ID.html#bpy.types.ID.bl_rna_get_subclass "bpy.types.ID.bl_rna_get_subclass") - [`ID.bl_rna_get_subclass_py`](bpy.types.ID.html#bpy.types.ID.bl_rna_get_subclass_py "bpy.types.ID.bl_rna_get_subclass_py") |

### References

|  |  |
| --- | --- |
| - [`bpy.context.active_object`](bpy.context.html#bpy.context.active_object "bpy.context.active_object") - [`bpy.context.edit_object`](bpy.context.html#bpy.context.edit_object "bpy.context.edit_object") - [`bpy.context.editable_objects`](bpy.context.html#bpy.context.editable_objects "bpy.context.editable_objects") - [`bpy.context.image_paint_object`](bpy.context.html#bpy.context.image_paint_object "bpy.context.image_paint_object") - [`bpy.context.object`](bpy.context.html#bpy.context.object "bpy.context.object") - [`bpy.context.objects_in_mode`](bpy.context.html#bpy.context.objects_in_mode "bpy.context.objects_in_mode") - [`bpy.context.objects_in_mode_unique_data`](bpy.context.html#bpy.context.objects_in_mode_unique_data "bpy.context.objects_in_mode_unique_data") - [`bpy.context.particle_edit_object`](bpy.context.html#bpy.context.particle_edit_object "bpy.context.particle_edit_object") - [`bpy.context.pose_object`](bpy.context.html#bpy.context.pose_object "bpy.context.pose_object") - [`bpy.context.sculpt_object`](bpy.context.html#bpy.context.sculpt_object "bpy.context.sculpt_object") - [`bpy.context.selectable_objects`](bpy.context.html#bpy.context.selectable_objects "bpy.context.selectable_objects") - [`bpy.context.selected_editable_objects`](bpy.context.html#bpy.context.selected_editable_objects "bpy.context.selected_editable_objects") - [`bpy.context.selected_objects`](bpy.context.html#bpy.context.selected_objects "bpy.context.selected_objects") - [`bpy.context.vertex_paint_object`](bpy.context.html#bpy.context.vertex_paint_object "bpy.context.vertex_paint_object") - [`bpy.context.visible_objects`](bpy.context.html#bpy.context.visible_objects "bpy.context.visible_objects") - [`bpy.context.weight_paint_object`](bpy.context.html#bpy.context.weight_paint_object "bpy.context.weight_paint_object") - [`Action.flip_with_pose`](bpy.types.Action.html#bpy.types.Action.flip_with_pose "bpy.types.Action.flip_with_pose") - [`ActionConstraint.target`](bpy.types.ActionConstraint.html#bpy.types.ActionConstraint.target "bpy.types.ActionConstraint.target") - [`ArmatureModifier.object`](bpy.types.ArmatureModifier.html#bpy.types.ArmatureModifier.object "bpy.types.ArmatureModifier.object") - [`ArrayModifier.curve`](bpy.types.ArrayModifier.html#bpy.types.ArrayModifier.curve "bpy.types.ArrayModifier.curve") - [`ArrayModifier.end_cap`](bpy.types.ArrayModifier.html#bpy.types.ArrayModifier.end_cap "bpy.types.ArrayModifier.end_cap") - [`ArrayModifier.offset_object`](bpy.types.ArrayModifier.html#bpy.types.ArrayModifier.offset_object "bpy.types.ArrayModifier.offset_object") - [`ArrayModifier.start_cap`](bpy.types.ArrayModifier.html#bpy.types.ArrayModifier.start_cap "bpy.types.ArrayModifier.start_cap") - [`BlendData.objects`](bpy.types.BlendData.html#bpy.types.BlendData.objects "bpy.types.BlendData.objects") - [`BlendDataMeshes.new_from_object`](bpy.types.BlendDataMeshes.html#bpy.types.BlendDataMeshes.new_from_object "bpy.types.BlendDa