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

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

Adjust Quad Strip

tb.ops.retopology.adjust_strip(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    faces: Sequence[int] = ...,
    width: float = 1.0,
    rotate: float = 0.0,
    quads: int = 0,
    offset: float = 0.0001,
) -> Result

Scale the width of one selected open quad strip, turn it on the reference about its middle, or rebuild it with a new quad count along the same curve (RetopoFlow strip editing). End rows shared with other faces stay attached.

  • Operation retopology.adjust_strip
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
facesSequence[int]—Stable face IDs of one open quad strip; omit to use the selected faces. (0…4294967295).
widthfloat1.0Width multiplier for every row. (0.05…20).
rotatefloat0.0Turn about the surface normal at the strip's middle, in degrees. (degrees; -180…180).
quadsint0New quad count along the strip; 0 keeps it. (0…256).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Quad Draw

tb.ops.retopology.begin(
    *,
    source: ObjectRef | None = ...,
    target: ObjectRef = ...,
) -> Result

Open the Quad Draw workspace over a reference and optional existing edit mesh. Gestures have local undo; Create Mesh publishes one global step and Cancel restores the start.

  • Operation retopology.begin
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef | None—Reference Mesh.
targetObjectRef—Edit Mesh.

Cancel Quad Draw

tb.ops.retopology.cancel() -> Result

Discard all workspace gestures and restore the original edit mesh and selection exactly.

  • Operation retopology.cancel
  • In Model

Closest Live Surface Points

tb.ops.retopology.closest(
    *,
    source: ObjectRef = ...,
    points: Any,
    eye: Vec3Like = ...,
    offset: float = 0.0001,
    backfaces: bool = False,
) -> Result

Find the nearest source surface point for each world-space query; source geometry stays untouched.

  • Operation retopology.closest
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
pointsAnyrequiredOne to 64 [x,y,z] points in world metres.
eyeVec3Like—World-space camera position; required when snapping to backfaces is off. (scene units).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).
backfacesboolFalseAllow placement on source faces pointing away from the camera.

Find a Boundary Edge to Extend

tb.ops.retopology.edge_candidate(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    ray: Any,
    backfaces: bool = False,
) -> Result

Nearest boundary edge midpoint to a projected source cursor, without a distance cap; read-only.

  • Operation retopology.edge_candidate
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
rayAnyrequiredRay.
backfacesboolFalseAllow placement on source faces pointing away from the camera.

Create Quad Draw Mesh

tb.ops.retopology.end() -> Result

Create or update the edit mesh, publishing the whole Quad Draw session as one undo step. An empty session is cancelled.

  • Operation retopology.end
  • In Model

Find an Edit Mesh Face

tb.ops.retopology.face_at(*, target: ObjectRef = ..., ray: Any) -> Result

The visible Edit Mesh face nearest along a camera ray; read-only.

  • Operation retopology.face_at
  • In Model
ArgumentTypeDefaultDescription
targetObjectRef—Target.
rayAnyrequiredRay.

Preview Boundary Face

tb.ops.retopology.face_candidate(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    ray: Any,
    mode: Literal["tri", "quad", "mixed"] = "mixed",
    offset: float = 0.0001,
    backfaces: bool = False,
) -> Result

Find the nearest valid boundary triangle or quad around a projected cursor. Read-only; Shift-click submits these same stable corners to mesh.draw_face.

  • Operation retopology.face_candidate
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
rayAnyrequiredRay.
modeLiteral["tri", "quad", "mixed"]"mixed"Mode (tri / quad / mixed).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).
backfacesboolFalseAllow placement on source faces pointing away from the camera.

Hide Quad Draw Vertices

tb.ops.retopology.hide(
    *,
    target: ObjectRef = ...,
    action: Literal["selected", "unselected", "reveal"] = "selected",
) -> Result

Hide the selected or unselected Edit Mesh vertices, or reveal all. Hidden vertices cannot be picked and brushes skip them.

  • Operation retopology.hide
  • In Model
ArgumentTypeDefaultDescription
targetObjectRef—Target.
actionLiteral["selected", "unselected", "reveal"]"selected"Action (selected / unselected / reveal).

Quad Draw Knife

tb.ops.retopology.knife(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    points: Any,
    eye: Vec3Like,
    offset: float = 0.0001,
) -> Result

Cut new edges across Edit Mesh faces along a polyline seen from the camera; the new vertices return to the reference.

  • Operation retopology.knife
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
pointsAnyrequiredThe cut as [[x,y,z], …] world points; a cut ending on its first point is closed.
eyeVec3LikerequiredCamera position; each segment cuts along the plane through it and the eye. (scene units).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Preview a Surface Edge Loop

tb.ops.retopology.loop_candidate(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    edge: int,
    position: float = 0.5,
    occlusion: bool = True,
    projected: bool = True,
    eye: Vec3Like = ...,
    offset: float = 0.0001,
    backfaces: bool = False,
) -> Result

Preview the shared quad-ring cut without changing the target. Scalar sliding only updates the cached ring's new vertices. New loop vertices project to the canonical evaluated surface.

  • Operation retopology.loop_candidate
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
edgeintrequiredStable target edge ID; position is measured from its stored first endpoint. (0…4294967295).
positionfloat0.5Position (0…1).
occlusionboolTrueReject a hovered edge hidden behind the reference. Captured press/drag uses false.
projectedboolTrueReturn projected points; false prepares the same retained ring for device preview.
eyeVec3Like—World-space camera position; required when snapping to backfaces is off. (scene units).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).
backfacesboolFalseAllow placement on source faces pointing away from the camera.

Mark Quad Draw Seams

tb.ops.retopology.mark_seam(
    *,
    target: ObjectRef = ...,
    vertices: Sequence[int] = ...,
    clear: bool = False,
) -> Result

Mark or clear UV seams on Edit Mesh edges whose two ends are both chosen vertices.

  • Operation retopology.mark_seam
  • In Model
ArgumentTypeDefaultDescription
targetObjectRef—Target.
verticesSequence[int]—Stable vertex IDs; omit to use the Edit Mesh's selected components. (0…4294967295).
clearboolFalseClear.

Mirror Quad Draw Mesh

tb.ops.retopology.mirror(
    *,
    target: ObjectRef = ...,
    axis: Literal["x", "y", "z"] = "x",
    side: Literal["positive", "negative"] = "positive",
    weld: float = ...,
) -> Result

Rebuild the Edit Mesh as one side of an axis plane plus its mirror. Points within the weld distance of the plane, and far corners of faces crossing it, snap onto the plane so both halves share one center line.

  • Operation retopology.mirror
  • In Model
ArgumentTypeDefaultDescription
targetObjectRef—Target.
axisLiteral["x", "y", "z"]"x"Axis (x / y / z).
sideLiteral["positive", "negative"]"positive"The side that is kept and copied. (positive / negative).
weldfloat—Center-line weld distance in the Edit Mesh's space. Default: 0.5 % of the reference's size. (scene units; 0…1000000).

Move Surface Vertices

tb.ops.retopology.move(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    vertices: Sequence[int] = ...,
    delta: Vec3Like,
    soft_radius: float = 0.0,
    soft_falloff: Literal["smooth", "linear", "sharp", "root", "sphere"] = "smooth",
    offset: float = 0.0001,
) -> Result

Move Edit Mesh vertices by a world offset and slide them back onto the reference. Soft selection carries nearby unpinned, visible vertices with a falloff; radius 1 reaches half the Edit Mesh's bounding-box diagonal.

  • Operation retopology.move
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
verticesSequence[int]—Stable vertex IDs; omit to use the Edit Mesh's selected components. (0…4294967295).
deltaVec3LikerequiredWorld-space movement before re-projection. (scene units).
soft_radiusfloat0.0Quad Draw soft radius (0: off; UI: 0.1–5). Effective radius = 0.5 × mesh bounding-box diagonal × this value. (0…5).
soft_falloffLiteral["smooth", "linear", "sharp", "root", "sphere"]"smooth"Soft Falloff (smooth / linear / sharp / root / sphere).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Preview Quad Patch

tb.ops.retopology.patch_plan(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    vertex: int = ...,
    vertices: Sequence[int] = ...,
    rows: int = 0,
    offset: float = 0.0001,
) -> Result

The quad grid Patches would fill a closed Edit Mesh hole with, as rows of world points; read-only.

  • Operation retopology.patch_plan
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
vertexint—A stable vertex on the hole's boundary; omit to fill the selected boundary loop. (0…4294967295).
verticesSequence[int]—Stable vertex ids of the boundary loop; omit to use the selection. (0…4294967295).
rowsint0Quads across the patch; 0 puts the corners where the boundary turns most. (0…256).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Pin Quad Draw Vertices

tb.ops.retopology.pin(
    *,
    target: ObjectRef = ...,
    vertices: Sequence[int] = ...,
    action: Literal["pin", "unpin", "clear"] = "pin",
) -> Result

Pin or unpin Edit Mesh vertices; relax, tweak and smoothing leave pinned vertices in place.

  • Operation retopology.pin
  • In Model
ArgumentTypeDefaultDescription
targetObjectRef—Target.
verticesSequence[int]—Stable vertex IDs; omit to use the Edit Mesh's selected components. (0…4294967295).
actionLiteral["pin", "unpin", "clear"]"pin"Action (pin / unpin / clear).

Preview PolyPen Insert

tb.ops.retopology.poly_pen_candidate(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    ray: Any,
    mode: Literal["triQuad", "quadOnly", "triOnly", "edgeOnly"] = "triQuad",
    vertices: Sequence[int] = ...,
    merge_radius: float = 0.0,
    insert_radius: float = 0.0,
    offset: float = 0.0001,
    backfaces: bool = False,
) -> Result

What mesh.poly_pen would do at this ray, with the outline it adds (world points); read-only.

  • Operation retopology.poly_pen_candidate
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—The Edit Mesh; omit to use Quad Draw's or create one.
rayAnyrequiredCamera ray {origin:[3],direction:[3]} through the cursor.
modeLiteral["triQuad", "quadOnly", "triOnly", "edgeOnly"]"triQuad"Insert Mode (triQuad / quadOnly / triOnly / edgeOnly).
verticesSequence[int]—Selected stable vertex IDs; omit to use the Edit Mesh's selection. (0…4294967295).
merge_radiusfloat0.0A new vertex this close (world) to an existing one merges into it (Quad Draw: 10 px). (scene units; 0…1000000).
insert_radiusfloat0.0An edge this close (world) is under the cursor: split, bridged or inserted into (Quad Draw: 15 px). (scene units; 0…1000000).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).
backfacesboolFalseAllow placement on source faces pointing away from the camera.

Project to Live Surface

tb.ops.retopology.project(
    *,
    source: ObjectRef = ...,
    rays: Any,
    offset: float = 0.0001,
    backfaces: bool = False,
    snap_radius: float = 0.0,
) -> Result

Project world-space camera rays onto the immutable evaluated source surface.

  • Operation retopology.project
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
raysAnyrequiredList of {origin:[x,y,z], direction:[x,y,z]} in world metres; misses return null.
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).
backfacesboolFalseAllow placement on source faces pointing away from the camera.
snap_radiusfloat0.0Snap a hit to the nearest reference vertex within this world radius (Quad Draw X); zero keeps the surface point. (scene units; 0…1000000).

Relax Surface Vertices

tb.ops.retopology.relax(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    vertices: Sequence[int] = ...,
    iterations: int = 2,
    strength: float = 0.5,
    center: Vec3Like = ...,
    radius: float = 0.1,
    falloff: Literal["smooth", "linear", "constant"] = "smooth",
    boundary: bool = False,
    offset: float = 0.0001,
) -> Result

Laplacian relax of Edit Mesh vertices on the reference: each step pulls a vertex toward its neighbours' mean, then re-projects it. Pinned and hidden vertices stay; boundaries stay unless Relax Boundary is on. With a brush center, only vertices inside the radius move, weighted by the falloff.

  • Operation retopology.relax
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
verticesSequence[int]—Stable vertex IDs; omit to use the Edit Mesh's selected components. (0…4294967295).
iterationsint2Iterations (1…100).
strengthfloat0.5Strength (0…1).
centerVec3Like—Brush center in world space; omit to relax the given or selected vertices. (scene units).
radiusfloat0.1Brush radius in world metres, used with a center. (scene units; 0.000001…1000000).
falloffLiteral["smooth", "linear", "constant"]"smooth"Falloff (smooth / linear / constant).
boundaryboolFalseRelax Boundary.
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Reshape Quad Strip

tb.ops.retopology.reshape_strip(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    faces: Sequence[int] = ...,
    controls: Any,
    offset: float = 0.0001,
) -> Result

Move one selected open quad strip onto a new center curve: each row keeps its width and place along the strip, turns to follow the curve and returns to the reference.

  • Operation retopology.reshape_strip
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
facesSequence[int]—Stable face IDs of one open quad strip; omit to use the selected faces. (0…4294967295).
controlsAnyrequiredFour world-space Bézier control points [[x,y,z], …], ends first and last.
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Quad Draw Rip

tb.ops.retopology.rip(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    vertices: Sequence[int] = ...,
    to: Vec3Like,
    fill: bool = False,
    offset: float = 0.0001,
) -> Result

Tear the Edit Mesh along the selected edges (each with a face on both sides) and move the copies on the side facing to out to it on the reference; fill closes the gap with quads (RetopoFlow Rip / Rip Fill). One undo step.

  • Operation retopology.rip
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
verticesSequence[int]—Stable vertex ids whose shared edges rip; omit to use the selection. (0…4294967295).
toVec3LikerequiredWorld point (the cursor on the reference) the torn side moves to. (scene units).
fillboolFalseClose the gap with quads (Rip Fill).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Live Surface

tb.ops.retopology.state() -> Result

The current live surface choice; cleared on project load and Model working-copy replacement.

  • Operation retopology.state
  • In Model

Quad Strip Curve

tb.ops.retopology.strip_curve(
    *,
    target: ObjectRef = ...,
    faces: Sequence[int] = ...,
) -> Result

The cubic Bézier fitted through the center of one selected open quad strip: four world-space control points (ends first and last); read-only.

  • Operation retopology.strip_curve
  • In Model
ArgumentTypeDefaultDescription
targetObjectRef—Target.
facesSequence[int]—Stable face IDs of one open quad strip; omit to use the selected faces. (0…4294967295).

Preview Quad Stroke

tb.ops.retopology.stroke_plan(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    points: Any,
    vertices: Sequence[int] = ...,
    spans: int = 0,
    shape: Literal["strip", "cycle", "ring", "equals", "l", "u", "c", "t", "i", "o", "d", "close"] = ...,
    match_counts: bool = False,
    offset: float = 0.0001,
) -> Result

How a stroke would be laid by Strokes: its shape, the other valid readings, whether Match counts is needed (and why), and the quads as world points; read-only.

  • Operation retopology.stroke_plan
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
pointsAnyrequiredThe stroke as [[x,y,z], …] world points on the reference.
verticesSequence[int]—Stable vertex ids of the selected edges; omit to use the selection. (0…4294967295).
spansint0Segments across the stroke; 0 matches the edge spacing. (0…64).
shapeLiteral["strip", "cycle", "ring", "equals", "l", "u", "c", "t", "i", "o", "d", "close"]—The reading to lay when the stroke has several (see alternatives from retopology.stroke_plan); omit for the first. (strip / cycle / ring / equals / l / u / c / t / i / o / d / close).
match_countsboolFalseSplit edges on the shorter existing side when the counts do not pair up (Match counts).
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Quad Draw Symmetry

tb.ops.retopology.symmetry(*, axes: Any = []) -> Result

Mirror every Quad Draw edit across the Edit Mesh's X, Y and / or Z planes (any combination: X and Z make four quarters). The side you edit is copied to the other side, and points near a plane weld onto it.

  • Operation retopology.symmetry
  • In Model
ArgumentTypeDefaultDescription
axesAny[]The mirror planes, e.g. ["x"] or ["x", "z"]; [] turns symmetry off.

Tweak Surface Vertices

tb.ops.retopology.tweak(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    center: Vec3Like,
    delta: Vec3Like,
    radius: float = 0.05,
    strength: float = 0.6,
    falloff: Literal["smooth", "linear", "constant"] = "smooth",
    pin_boundary: bool = True,
    offset: float = 0.0001,
) -> Result

Grab-brush step: vertices inside the radius move by the offset times strength and falloff, then return to the reference. Pinned and hidden vertices stay; Pin Boundary keeps open-boundary vertices.

  • Operation retopology.tweak
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
centerVec3LikerequiredCenter (scene units).
deltaVec3LikerequiredDelta (scene units).
radiusfloat0.05Radius (scene units; 0.000001…1000000).
strengthfloat0.6Strength (0…1).
falloffLiteral["smooth", "linear", "constant"]"smooth"Falloff (smooth / linear / constant).
pin_boundaryboolTruePin Boundary.
offsetfloat0.0001Normal offset from the source in world metres; zero places points exactly on it. (scene units; 0…1).

Find a Surface Vertex Snap Target

tb.ops.retopology.vertex_candidate(
    *,
    source: ObjectRef = ...,
    target: ObjectRef = ...,
    point: Vec3Like,
    radius: float,
    exclude: int = ...,
) -> Result

Nearest target vertex in a strict world-space radius, including adjacent and interior vertices; excludes the stable dragged vertex id.

  • Operation retopology.vertex_candidate
  • In Model
ArgumentTypeDefaultDescription
sourceObjectRef—Source mesh placement; defaults to Make Live, else the sole selected object.
targetObjectRef—Target.
pointVec3LikerequiredPoint (scene units).
radiusfloatrequiredRadius (scene units; 0…1000000).
excludeint—Exclude (0…4294967295).