› cavi-ai/
GitHub ↗

Edit objects

object_edit creates or changes one object. Every action needs a lease_id. Unrelated action parameters are refused before contacting Blender.

Actions

ActionParameters
create_primitivekind = cube, sphere, cylinder, cone or plane; location
create_meshvertices, faces; zero-based outward winding
transformlocation, rotation_degrees (XYZ Euler), scale
set_colorrgba, slot (default 0)
shadesmooth
apply_transformscomponents from location, rotation, scale; make_single_user
set_originorigin = bounds_bottom_center, bounds_center, world_origin or point; location for point
snap_to_gridgrid
renamenew_name; also renames single-user mesh data
add_socketnew_name, local location, rotation_degrees
duplicatenew_name, count, world offset, linked
parentnew_name is the parent; preserves world transform
unparentno extra parameters; preserves world transform
move_to_collectionnew_name, create
shape_key_addnew_name, value, sparse offsets, or source mesh
shape_key_valuenew_name, value
shape_key_keyframenew_name, action_name, keyframes = 1–32 {frame, value}
shape_key_removenew_name; Basis cannot be removed

Transforms and origins

transform honors the object's rotation mode. rotation_degrees is always XYZ Euler input.

apply_transforms bakes the selected components into mesh data. Shared mesh data needs make_single_user=true. Children keep their world transforms.

set_origin moves the object origin without moving geometry. point takes a world-space location; the other modes use local bounds or world zero.

Names and hierarchy

rename refuses an existing object name. add_socket creates an empty named SOCKET_<new_name> at a local offset under the object.

parent refuses cycles and preserves the child's world transform. unparent does the same while removing the parent.

Duplicates and collections

duplicate creates new_name or <new_name>_01 through _NN for multiple copies. linked=true shares mesh data; the default copies it. Each copy is offset in world space by its index.

move_to_collection moves the object to a named collection. create=true creates the collection when missing.

Shape keys

Shape-key actions require single-user mesh data. shape_key_add creates Basis when needed, then adds the named key. offsets are sparse [vertex_index, x, y, z] local displacements; source copies local vertex positions from another mesh with the same vertex count.

shape_key_keyframe creates a new action atomically with 1–32 strictly increasing frames and values from 0 to 1. Values are applied and keyed in order; the previous action, value and scene frame are restored on failure.