Skip to content
AlphaToolBox3D is in early alpha: features are incomplete and things can break. Use it at your own risk and keep copies of your files. Report a problem
ToolBox3D

Docs · Python API

tb.ops.object

17 operations. Without targets=, an operation works on the current selection, like its button in the editor.

Align Objects

tb.ops.object.align(
    *,
    nodes: Sequence[ObjectRef] = ...,
    active: ObjectRef = ...,
    axis: Literal["x", "y", "z", "all"] = "x",
    side: Literal["min", "center", "max"] = "center",
    relative_to: Literal["active", "selection", "origin"] = "active",
    use_pivot: bool = False,
    targets: Targets = None,
) -> Result

Line objects up on an axis: their low sides, centers, high sides or pivots meet the active object, the bounds of all the objects or the world origin.

  • Operation object.align
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to move, in order (default: the selected objects).
activeObjectRef—The active object (default: the selection's active object, else the last one).
axisLiteral["x", "y", "z", "all"]"x"Axis to align on, or all three. (x / y / z / all).
sideLiteral["min", "center", "max"]"center"Which part of each object lines up: its low side, center or high side. (min / center / max).
relative_toLiteral["active", "selection", "origin"]"active"Line up with the active object (it stays still), the bounds of all the objects, or the world origin. (active / selection / origin).
use_pivotboolFalseAlign the pivots instead of the bounding boxes.

Align Axes to Model

tb.ops.object.align_axes_to_model(
    *,
    nodes: Sequence[ObjectRef] = ...,
    targets: Targets = None,
) -> Result

Turn each mesh object's local axes onto the model's own principal directions and turn its points the opposite way, so nothing moves on screen; local-axis tools (symmetry, mirror) then line up with a part modelled or imported rotated.

  • Operation object.align_axes_to_model
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Mesh objects to align (default: the selected objects).

Clear Live Surface

tb.ops.object.clear_live() -> Result

Stop using a mesh as the live drawing surface.

  • Operation object.clear_live
  • In Model

Combine Meshes

tb.ops.object.combine(
    *,
    nodes: Sequence[ObjectRef] = ...,
    active: ObjectRef = ...,
    targets: Targets = None,
) -> Result

Join the selected mesh objects into the active one: their points are moved into its space so nothing moves on screen, materials, weight maps, blendshape targets and attributes are merged, and the other objects are removed (their children move to the combined object).

  • Operation object.combine
  • Works on selected objects (at least 2)
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Mesh objects to combine (default: the selected objects).
activeObjectRef—The active object (default: the selection's active object, else the last one).

Copy

tb.ops.object.copy(
    *,
    nodes: Sequence[ObjectRef] = ...,
    targets: Targets = None,
) -> Result

Copy the selected objects with everything below them to the clipboard. The scene is unchanged; Paste adds independent copies in the Model editor, also after the originals were deleted.

  • Operation object.copy
  • Works on selected objects
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to copy (default: the selected objects).

Cut

tb.ops.object.cut(
    *,
    nodes: Sequence[ObjectRef] = ...,
    targets: Targets = None,
) -> Result

Copy the selected objects to the clipboard and delete them, in one undo step.

  • Operation object.cut
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to cut (default: the selected objects).

Distribute Objects

tb.ops.object.distribute(
    *,
    nodes: Sequence[ObjectRef] = ...,
    axis: Literal["x", "y", "z"] = "x",
    mode: Literal["even", "gap"] = "even",
    gap: float = 0.0,
    order: Literal["position", "pick"] = "position",
    use_pivot: bool = False,
    targets: Targets = None,
) -> Result

Spread objects along an axis: Even keeps the first and last object and makes the gaps equal; Gap places each object a fixed distance after the previous one.

  • Operation object.distribute
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to move, in order (default: the selected objects).
axisLiteral["x", "y", "z"]"x"Axis to spread the objects along. (x / y / z).
modeLiteral["even", "gap"]"even"Even spacing between the outer objects, or a fixed gap. (even / gap).
gapfloat0.0Distance between neighbouring objects (Gap mode). (scene units).
orderLiteral["position", "pick"]"position"Order the objects by where they are along the axis, or by selection order. (position / pick).
use_pivotboolFalseMeasure between pivots instead of between bounding boxes.

Duplicate Along Curve

tb.ops.object.duplicate_along_curve(
    *,
    curve: ObjectRef = ...,
    nodes: Sequence[ObjectRef] = ...,
    count: int = 8,
    align: bool = True,
    twist_start: float = 0.0,
    twist_end: float = 0.0,
    noise: float = 0.0,
    targets: Targets = None,
) -> Result

Distribute independent copies of objects evenly along a path curve, each turned so its +Z follows the curve (Align), with an optional twist from start to end and a position noise. The originals stay; the copies become the selection.

  • Operation object.duplicate_along_curve
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
curveObjectRef—Path curve (default: the selected curve).
nodesSequence[ObjectRef]—Objects to copy (default: the other selected objects).
countint8Copies of each object. (count; 2…4096).
alignboolTrueTurn each copy so its +Z follows the curve; off keeps the object's own rotation.
twist_startfloat0.0Roll about the curve at the first copy. (degrees).
twist_endfloat0.0Roll about the curve at the last copy (copies between blend). (degrees).
noisefloat0.0Random offset of each copy, up to this distance per axis (repeatable). (scene units; 0…179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000).

Freeze Transforms

tb.ops.object.freeze_transform(
    *,
    nodes: Sequence[ObjectRef] = ...,
    translate: bool = True,
    rotate: bool = True,
    scale: bool = True,
    targets: Targets = None,
) -> Result

Bake the chosen transform channels into each mesh's points and reset those channels (translate 0, rotate 0, scale 1). Normals, blendshape targets and winding follow; children keep their world placement; a skinned mesh keeps its bound pose.

  • Operation object.freeze_transform
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to freeze (default: the selected objects).
translateboolTrueBake and reset the translation.
rotateboolTrueBake and reset the rotation.
scaleboolTrueBake and reset the scale.

Instance

tb.ops.object.instance(
    *,
    nodes: Sequence[ObjectRef] = ...,
    targets: Targets = None,
) -> Result

Create a placement beside each selected mesh or curve object that shares its data: editing one edits all. The instances become the selection.

  • Operation object.instance
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to instance (default: the selected objects).

Make Live

tb.ops.object.make_live(*, source: ObjectRef = ..., targets: Targets = None) -> Result

Use this mesh as the reference surface for polygon drawing; its geometry stays untouched.

  • Operation object.make_live
  • Works on selected objects (exactly 1)
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.

Make Single User

tb.ops.object.make_single_user(
    *,
    nodes: Sequence[ObjectRef] = ...,
    targets: Targets = None,
) -> Result

Give each selected object its own copy of the mesh or curve data it shares with other objects, so editing it no longer edits the others. When every user of the data is selected, the last one keeps the original.

  • Operation object.make_single_user
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to make single-user (default: the selected objects).

Paste

tb.ops.object.paste() -> Result

Paste the copied objects as independent copies: under their original parent while it exists (keeping their local placement), else at the scene root keeping their copied world placement. The copies become the selection.

  • Operation object.paste
  • In Model

Pattern Duplicate

tb.ops.object.pattern_duplicate(
    *,
    nodes: Sequence[ObjectRef] = ...,
    pattern: Literal["linear", "grid", "radial"] = "linear",
    fit: Literal["count", "length", "curve"] = "count",
    fit_curve: ObjectRef = ...,
    count: int = 2,
    fit_length: float = 1.0,
    use_relative_offset: bool = True,
    relative_offset: Vec3Like = [1.0, 0.0, 0.0],
    use_constant_offset: bool = False,
    constant_offset: Vec3Like = [0.0, 0.0, 0.0],
    offset_object: ObjectRef = ...,
    start_cap: ObjectRef = ...,
    end_cap: ObjectRef = ...,
    grid_counts: Vec3Like = [2.0, 2.0, 1.0],
    grid_spacing: Vec3Like = [1.0, 1.0, 1.0],
    grid_gap: Vec3Like = [0.0, 0.0, 0.0],
    radial_axis: Literal["x", "y", "z"] = "y",
    radial_angle: float = 360.0,
    radial_radius: float = 1.0,
    targets: Targets = None,
) -> Result

Repeat objects as separate copies in a linear, grid or radial pattern. Copies are independent objects placed exactly where the single-mesh Pattern modifier would put them. Linear also takes an Offset Object, Fit Curve and start / end caps.

  • Operation object.pattern_duplicate
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to repeat (default: the selected objects).
patternLiteral["linear", "grid", "radial"]"linear"Linear repeats along an offset, Grid fills X/Y/Z cells, Radial repeats around an axis. (linear / grid / radial).
fitLiteral["count", "length", "curve"]"count"Linear: a fixed number of copies, or as many as fit a length or a curve's length. (count / length / curve).
fit_curveObjectRef—Fit Curve: the curve whose length the copies fill.
countint2Copies including the source (Linear Fixed Count and Radial). (1…10000).
fit_lengthfloat1.0Length to fill (Fit Length). (scene units; 0…1000000000).
use_relative_offsetboolTrueOffset in multiples of the object size.
relative_offsetVec3Like[1.0, 0.0, 0.0]Offset per copy in multiples of the object's size.
use_constant_offsetboolFalseAdd a fixed distance per copy.
constant_offsetVec3Like[0.0, 0.0, 0.0]Offset distance per copy. (scene units).
offset_objectObjectRef—Linear: each copy also takes this object's move, turn and scale relative to the source (rotate an empty to make a spiral).
start_capObjectRef—Linear: a copy of this object one step before the source.
end_capObjectRef—Linear: a copy of this object one step after the last copy.
grid_countsVec3Like[2.0, 2.0, 1.0]Grid copies per axis.
grid_spacingVec3Like[1.0, 1.0, 1.0]Grid step in multiples of the object size.
grid_gapVec3Like[0.0, 0.0, 0.0]Extra grid gap per axis. (scene units).
radial_axisLiteral["x", "y", "z"]"y"Axis the ring turns around. (x / y / z).
radial_anglefloat360.0Sweep of the ring; copy i sits at angle × i / count. (degrees; -360…360).
radial_radiusfloat1.0Ring radius; the source sits on the ring. (scene units).

Reset Transforms

tb.ops.object.reset_transform(
    *,
    nodes: Sequence[ObjectRef] = ...,
    targets: Targets = None,
) -> Result

Set translation 0, rotation 0 and scale 1 on each object; the points are kept.

  • Operation object.reset_transform
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to reset (default: the selected objects).

Set Origin

tb.ops.object.set_origin(
    *,
    nodes: Sequence[ObjectRef] = ...,
    type: Literal["origin_to_geometry", "origin_to_point", "origin_to_selection", "geometry_to_origin"] = "origin_to_geometry",
    center: Literal["bounds", "median"] = "bounds",
    location: Vec3Like = [0.0, 0.0, 0.0],
    targets: Targets = None,
) -> Result

Move each object's origin, which is its pivot, without moving anything on screen: to the center of its geometry, to a world point or to the center of the selected components; or move the geometry so its center sits on the origin. Data shared by several objects moves once and every object using it stays in place; children keep their placement and channels.

  • Operation object.set_origin
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects whose origin moves (default: the selected objects; Origin to Selection: the objects with selected components).
typeLiteral["origin_to_geometry", "origin_to_point", "origin_to_selection", "geometry_to_origin"]"origin_to_geometry"Where the origin goes, or Geometry to Origin to move the geometry instead. (origin_to_geometry / origin_to_point / origin_to_selection / geometry_to_origin).
centerLiteral["bounds", "median"]"bounds"Center of the geometry: its bounding box or the mean of its points (Origin to Geometry, Geometry to Origin). (bounds / median).
locationVec3Like[0.0, 0.0, 0.0]World point the origin moves to (Origin to Point). (scene units).

Snap Objects

tb.ops.object.snap(
    *,
    nodes: Sequence[ObjectRef] = ...,
    active: ObjectRef = ...,
    to: Literal["grid", "active", "origin"] = "grid",
    grid_step: float = 1.0,
    targets: Targets = None,
) -> Result

Move each object's pivot to the nearest grid point, onto the active object, or to the world origin.

  • Operation object.snap
  • Works on selected objects
  • In Model
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]—Objects to move (default: the selected objects).
activeObjectRef—The active object (default: the selection's active object, else the last one).
toLiteral["grid", "active", "origin"]"grid"Nearest grid point, the active object's pivot or the world origin. (grid / active / origin).
grid_stepfloat1.0Grid spacing for Snap to Grid (the viewport's translate snap step). (scene units; 0.000001…1000000).