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.selection

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

Deselect All

tb.ops.selection.clear() -> Result

Clear the object, component, rig and guide selection.

  • Operation selection.clear
  • In Previewer, Model, Control Rig, Animation, Texture Paint

Deselect Components

tb.ops.selection.clear_components(
    *,
    kind: Literal["vertex", "edge", "face"] = ...,
) -> Result

Clear the component selection of one kind (default: the current mode's) on every mesh; objects stay selected.

  • Operation selection.clear_components
  • In Model, Control Rig
ArgumentTypeDefaultDescription
kindLiteral["vertex", "edge", "face"]—Component kind to clear (default: the current mode). (vertex / edge / face).

Selected Components

tb.ops.selection.components(*, mesh: MeshRef = ...) -> Result

The selected vertices, edges and faces of each mesh as dense indices (ascending), with the active component. One entry per mesh with a component selection, or only 'mesh'. Read-only.

  • Operation selection.components
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
meshMeshRef—Only this mesh (default: every mesh with a component selection).

Convert Selection

tb.ops.selection.convert(
    *,
    uv_map: str = ...,
    to: Literal["vertex", "edge", "face", "island", "uv"],
    from_: Literal["vertex", "edge", "face", "island", "uv"] = ...,
) -> Result

Convert the component selection to another kind: vertices → edges/faces whose vertices are all selected; edges/faces → all their vertices; edges → faces using them; faces → all their edges; anything → the islands (connected pieces) it touches; islands → all their elements; to/from UVs through the face corners (the UV pane's selection). Switches the Model editor to the target mode; UV targets keep it.

  • Operation selection.convert
  • In Model, Control Rig
ArgumentTypeDefaultDescription
uv_mapstr—UV map to edit (default: each mesh's displayed UV map, or its active map before a view choice).
toLiteral["vertex", "edge", "face", "island", "uv"]requiredThe component type the selection becomes: vertices, edges, faces, UV islands or UVs. (vertex / edge / face / island / uv).
from_Literal["vertex", "edge", "face", "island", "uv"]—Source kind (default: the current component mode). Pass 'uv' to convert the UV selection. (vertex / edge / face / island / uv).

Grow

tb.ops.selection.grow(*, face_step: bool = False) -> Result

Expand the component selection by one topological ring (on every mesh with a selection).

  • Operation selection.grow
  • In Model, Control Rig
ArgumentTypeDefaultDescription
face_stepboolFalseStep over whole faces (elements sharing a corner) instead of single edges.

Invert Selection

tb.ops.selection.invert() -> Result

Object mode: select exactly the visible, unlocked mesh and curve objects that are not selected. Component modes: invert the components of the current kind on the meshes of the selected objects.

  • Operation selection.invert
  • In Previewer, Model, Control Rig, Animation, Texture Paint

Loop to Region

tb.ops.selection.loop_to_region(*, select_bigger: bool = False) -> Result

Select the faces enclosed by the selected edge loop; switches to face mode.

  • Operation selection.loop_to_region
  • In Model
ArgumentTypeDefaultDescription
select_biggerboolFalseSelect the larger region instead of the enclosed (smaller) one.

Region to Loop

tb.ops.selection.region_to_loop() -> Result

Select the boundary edges of the selected faces; switches to edge mode.

  • Operation selection.region_to_loop
  • In Model

Select Objects

tb.ops.selection.select(
    *,
    nodes: Sequence[ObjectRef],
    mode: Literal["replace", "add", "remove", "toggle"] = "replace",
    active: ObjectRef = ...,
) -> Result

Select objects by id, name or path. One undo step (none when the selection does not change).

  • Operation selection.select
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
nodesSequence[ObjectRef]requiredNodes.
modeLiteral["replace", "add", "remove", "toggle"]"replace"How to combine with the current selection. (replace / add / remove / toggle).
activeObjectRef—Object to make active (default: the last one selected).

Select All

tb.ops.selection.select_all() -> Result

Object mode: select every visible, unlocked mesh and curve object (selected objects that cannot be picked stay selected). Component modes: select every component of the current kind on the meshes of the selected objects.

  • Operation selection.select_all
  • In Previewer, Model, Control Rig, Animation, Texture Paint

Select by Face Sides

tb.ops.selection.select_by_face_sides(
    *,
    count: int = 3,
    comparison: Literal["equal", "less", "greater", "notEqual"] = "equal",
) -> Result

Select faces by their vertex count (triangles, quads, n-gons); switches to face mode.

  • Operation selection.select_by_face_sides
  • In Model
ArgumentTypeDefaultDescription
countint3Number of sides to compare with (3 = triangles, 4 = quads). (3…1000000).
comparisonLiteral["equal", "less", "greater", "notEqual"]"equal"Selects faces with exactly, fewer than or more than this many sides. (equal / less / greater / notEqual).

Select Components

tb.ops.selection.select_components(
    *,
    mesh: MeshRef,
    kind: Literal["vertex", "edge", "face", "island"],
    indices: Sequence[int] = ...,
    ranges: Sequence[int] = ...,
    mode: Literal["replace", "add", "remove", "toggle"] = "replace",
    surface: bool = False,
) -> Result

Select vertices, edges (vertex index pairs), faces or islands (any face index of the island) of a mesh by dense index; stored by stable element id. Local inspection needs no unique scene placement; world-space tools resolve that separately. Switches to that component mode and keeps the editing mesh independent from the active handle.

  • Operation selection.select_components
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
meshMeshRefrequiredMesh.
kindLiteral["vertex", "edge", "face", "island"]requiredKind (vertex / edge / face / island).
indicesSequence[int]—Dense indices (give these or ranges). (0…4294967295).
rangesSequence[int]—Half-open dense index ranges as flattened start, end pairs: the compact form of a large area selection (give these or indices). (0…4294967295).
modeLiteral["replace", "add", "remove", "toggle"]"replace"How to combine with the current selection. (replace / add / remove / toggle).
surfaceboolFalseFaces: grow each face to the whole surface it belongs to, the way a B-rep face reads (CAD mode picks): a flat face across its coplanar splits (a boolean top around a hole), a curved surface (a cylinder wall, a bevel's rounded strip) across edges not sharper than 30° and not marked sharp.

Select Interior Faces

tb.ops.selection.select_interior_faces(
    *,
    mode: Literal["volume", "noBoundary"] = "volume",
) -> Result

Select faces inside the mesh volume, such as the wall left between two joined boxes; switches to face mode.

  • Operation selection.select_interior_faces
  • In Model
ArgumentTypeDefaultDescription
modeLiteral["volume", "noBoundary"]"volume"'volume': faces inside the mesh volume. 'noBoundary': every face without a boundary or non-manifold edge. (volume / noBoundary).

Select Linked

tb.ops.selection.select_linked() -> Result

Select all geometry connected to the current component selection.

  • Operation selection.select_linked
  • In Model, Control Rig

Select Edge Loop

tb.ops.selection.select_loop() -> Result

Extend every selected edge to its whole edge loop (across four-way vertices, along open borders).

  • Operation selection.select_loop
  • In Model, Control Rig

Select Loose

tb.ops.selection.select_loose(*, extend: bool = False) -> Result

Select loose points (no edges), wire edges (no faces) or loose faces (no neighbouring face) in the current mode (vertex mode from object mode).

  • Operation selection.select_loose
  • In Model
ArgumentTypeDefaultDescription
extendboolFalseAdd the loose elements to the current selection instead of replacing it.

Select Mirror

tb.ops.selection.select_mirror(
    *,
    axes: Any = ["x"],
    extend: bool = False,
    topology: bool = False,
) -> Result

Select mirrored counterparts across local axes using positions or symmetric polygon connectivity.

  • Operation selection.select_mirror
  • In Model
ArgumentTypeDefaultDescription
axesAny["x"]Local mirror planes to apply, in order: a list of "x", "y", "z" (default: X).
extendboolFalseKeep the current selection and add the mirrored elements.
topologyboolFalsePair components by polygon connectivity from a symmetry-plane edge, including displaced symmetric sides.

Select Non-Manifold

tb.ops.selection.select_non_manifold(
    *,
    extend: bool = False,
    wire: bool = True,
    boundary: bool = True,
    multi_face: bool = True,
    non_contiguous: bool = True,
    vertices: bool = True,
) -> Result

Select non-manifold geometry: wire, boundary and multi-face edges, edges between faces with flipped winding, and bowtie vertices (edge mode from object mode).

  • Operation selection.select_non_manifold
  • In Model
ArgumentTypeDefaultDescription
extendboolFalseAdd to the current selection instead of replacing it.
wireboolTrueWire edges (no faces).
boundaryboolTrueOpen boundary edges (one face).
multi_faceboolTrueEdges shared by more than two faces.
non_contiguousboolTrueEdges between two faces wound in opposite directions.
verticesboolTrueVertices whose faces form separate fans (bowties) or that only touch wire edges (vertex mode).

Select Nth (Checker Deselect)

tb.ops.selection.select_nth(
    *,
    nth: int = 2,
    offset: int = 0,
    skip: int = 1,
    mode: Literal["vertex", "edge", "face"] = ...,
) -> Result

Deselect every nth component of the selection in a checker pattern, walking out from the active component (selects everything first when nothing is selected).

  • Operation selection.select_nth
  • In Model
ArgumentTypeDefaultDescription
nthint2Interval length (2 = every other component). (1…1000000).
offsetint0Shift of the pattern. (0…1000000).
skipint1How many consecutive components stay selected in each interval. Must not exceed nth. (1…1000000).
modeLiteral["vertex", "edge", "face"]—Component mode to work in; defaults to the current one (faces from object mode). (vertex / edge / face).

Select Points Outside Sets

tb.ops.selection.select_outside_sets(
    *,
    meshes: Sequence[MeshRef] = ...,
    extend: bool = False,
) -> Result

Select the points that belong to no Vertex Set and switch to vertex mode. Meshes without Vertex Sets are skipped.

  • Operation selection.select_outside_sets
  • In Model
ArgumentTypeDefaultDescription
meshesSequence[MeshRef]—Meshes to search (default: meshes with a component selection, else the selected mesh objects).
extendboolFalseAdd to the vertex selection instead of replacing it.

Select Random

tb.ops.selection.select_random(
    *,
    ratio: float = 0.5,
    seed: int = 0,
    action: Literal["select", "deselect"] = "select",
    mode: Literal["vertex", "edge", "face"] = ...,
) -> Result

Randomly select or deselect an exact share of the components (repeatable with the same seed).

  • Operation selection.select_random
  • In Model
ArgumentTypeDefaultDescription
ratiofloat0.5Share of the components to select or deselect (0 to 1). (0…1).
seedint0Random seed; the same seed gives the same pattern. (0…4294967295).
actionLiteral["select", "deselect"]"select"Add random components, or remove random components from the selection. (select / deselect).
modeLiteral["vertex", "edge", "face"]—Component mode to work in; defaults to the current one (faces from object mode). (vertex / edge / face).

Select Bones / Controls

tb.ops.selection.select_rig(
    *,
    bones: Any = ...,
    controls: Any = ...,
    items: Any = ...,
    active: str = ...,
    mode: Literal["replace", "add", "remove", "toggle"] = "replace",
) -> Result

Select skeleton bones (by name or id) or rig controls (by id, or the name their animation curves record). Bones and controls are exclusive categories: selecting one kind clears the other (in the Previewer they also replace the object selection). One undo step.

  • Operation selection.select_rig
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
bonesAny—Bone names or ids.
controlsAny—Control ids or names; in Skeleton Rig mode also body-rig goal ids (armL/end).
itemsAny—Control Rig hierarchy: ordered typed {kind: node|bone|control, id} members. Mixed categories are combined atomically; the last surviving requested member is primary. Use instead of bones/controls/active.
activestr—Bone or control to make active after selection, by the same name/id resolution. It must remain selected; the active item is last in selection order.
modeLiteral["replace", "add", "remove", "toggle"]"replace"How to combine with the current selection. (replace / add / remove / toggle).

Select Edge Ring

tb.ops.selection.select_ring() -> Result

Extend every selected edge to its edge ring (the opposite edges across quads).

  • Operation selection.select_ring
  • In Model, Control Rig

Select Sharp Edges

tb.ops.selection.select_sharp_edges(*, threshold: float = 30.0) -> Result

Select edges whose adjacent faces meet at or above the angle, plus open and non-manifold edges; switches to edge mode.

  • Operation selection.select_sharp_edges
  • In Model
ArgumentTypeDefaultDescription
thresholdfloat30.0Minimum angle between the face normals, in degrees. (degrees; 0…180).

Select Side of Active

tb.ops.selection.select_side_of_active(
    *,
    axis: Literal["x", "y", "z"] = "x",
    sign: Literal["positive", "negative", "aligned"] = "positive",
    threshold: float = 0.0001,
    orientation: Literal["local", "global"] = "local",
    active_vertex: int = ...,
    mesh: MeshRef = ...,
) -> Result

Select every vertex on one side of the active vertex along an axis, or aligned with it.

  • Operation selection.select_side_of_active
  • In Model
ArgumentTypeDefaultDescription
axisLiteral["x", "y", "z"]"x"Axis to compare along. (x / y / z).
signLiteral["positive", "negative", "aligned"]"positive"Select the positive side, the negative side, or points aligned with the active vertex. (positive / negative / aligned).
thresholdfloat0.0001Tolerance around the active vertex, in mesh units. (scene units; 0…50).
orientationLiteral["local", "global"]"local"Compare in object (local) or world (global) coordinates. (local / global).
active_vertexint—Vertex to measure from; defaults to the active (last selected) vertex. (0…4294967295).
meshMeshRef—Mesh of the active vertex (default: the mesh of the active component).

Select Similar

tb.ops.selection.select_similar(
    *,
    property: str = ...,
    threshold: float = 0.1,
    compare: Literal["equal", "greater", "less"] = "equal",
) -> Result

Select every component similar to a selected one by a property (faces: area, sides, normal, perimeter, coplanar, material, smooth; edges: length, face angle, face count, direction, seam, sharp, crease, bevel weight; vertices: connected edges / faces, normal, crease, weight maps).

  • Operation selection.select_similar
  • In Model
ArgumentTypeDefaultDescription
propertystr—Property to compare (default: the first property of the current mode: area, length or connectedEdges).
thresholdfloat0.1Area / perimeter / length: fraction of the reference; normal / coplanar / direction: 1 − cos of the angle; face angle: degrees; crease / bevel weight: absolute difference. (0…1000000).
compareLiteral["equal", "greater", "less"]"equal"Selects components whose value is equal to, greater than or less than the selected ones' value. (equal / greater / less).

Selection Mode

tb.ops.selection.set_mode(
    *,
    mode: Literal["object", "vertex", "edge", "face", "island", "uv", "cad"],
    node: ObjectRef = ...,
) -> Result

Switch between object, vertex, edge, face, island, UV and CAD selection (CAD selects points, edges and faces together). Model and Control Rig may hold a component-mode intent before a mesh exists; tools validate editable targets when used. UV mode requires Model and a UV map. Without an existing component context or selected editable mesh, uses the first pickable mesh (Control Rig prefers a skinned mesh). Between vertex, edge and face the selection converts through its vertices. Object mode releases the edit lock and retains local membership until another object selection parks it.

  • Operation selection.set_mode
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
modeLiteral["object", "vertex", "edge", "face", "island", "uv", "cad"]requiredMode (object / vertex / edge / face / island / uv / cad).
nodeObjectRef—Optional exact object to select atomically when entering Object mode; other modes refuse it.

Track Selection Order

tb.ops.selection.set_track_order(
    *,
    vertex: bool = ...,
    edge: bool = ...,
    face: bool = ...,
) -> Result

Per component kind, keep the order components are picked in: Merge at First / Last and other pick-order tools read it. Off (the default) makes large selections much faster and lists components in index order. Object selections always keep their order. Without parameters it returns the current setting. A preference, not an undo step.

  • Operation selection.set_track_order
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
vertexbool—Keep pick order for this kind (omit to leave the setting unchanged).
edgebool—Keep pick order for this kind (omit to leave the setting unchanged).
facebool—Keep pick order for this kind (omit to leave the setting unchanged).

Shortest Path Select

tb.ops.selection.shortest_path(
    *,
    mesh: MeshRef,
    kind: Literal["vertex", "edge", "face"],
    from_: int,
    to: int,
) -> Result

Add the shortest path between two components of one mesh (Ctrl+Shift+click from the last selected component).

  • Operation selection.shortest_path
  • In Model, Control Rig
ArgumentTypeDefaultDescription
meshMeshRefrequiredMesh.
kindLiteral["vertex", "edge", "face"]requiredKind (vertex / edge / face).
from_intrequiredDense index of the start component. (0…4294967295).
tointrequiredDense index of the end component. (0…4294967295).

Shrink

tb.ops.selection.shrink(*, face_step: bool = False) -> Result

Contract the component selection from its outer components.

  • Operation selection.shrink
  • In Model, Control Rig
ArgumentTypeDefaultDescription
face_stepboolFalseStep over whole faces (elements sharing a corner) instead of single edges.