Bake Garment
tb.ops.garment.bake(
*,
session_id: str = ...,
pose: Literal["settled", "current"] = "settled",
next: bool = False,
wrinkle_maps_later: bool = False,
) -> Result
Write the draped garment as ordinary editable meshes, welded and with thickness and smoothing modifiers as set, in one undo step, and close the session.
Begin Garment
tb.ops.garment.begin(
*,
panels: Sequence[ObjectRef] = ...,
avatars: Sequence[ObjectRef] = ...,
clear_physics: bool = False,
fabric: Literal["cotton", "jersey", "silk", "denim", "wool", "leather", "canvas", "nylon", "hide", "linen", "chiffon", "satin"] = ...,
gravity: float = 9.81,
assembly_frames: int = 90,
drape_frames: int = 150,
seam_strength: float = 1.0,
seam_tolerance: float = 0.03,
iterations: int = 24,
ground_plane: bool = True,
damping: float = ...,
stretch_stiffness: float = 1.0,
weft_stiffness: float = 1.0,
warp_stiffness: float = 1.0,
bias_stiffness: float = 1.0,
bend_stiffness: float = 1.0,
weight: float = 1.0,
fabric_friction: float = 1.0,
self_collision: bool = False,
self_collision_thickness: float = 0.004,
self_collision_iterations: int = 2,
thickness: float = ...,
smooth_levels: int = 1,
weld_seams: bool = True,
lods: int = 0,
wrinkle_map: bool = True,
name: str = ...,
) -> Result
Open a garment: your flat cloth panels are sewn and draped around avatar meshes in the Physics world. The garment is scene data (one undo step per change, saved with the project); Bake turns it into ordinary meshes.
Add Base Body
tb.ops.garment.body.add(
*,
body: Literal["female", "male"],
carry: bool = False,
grade: bool = True,
) -> Result
Add a generic female or male mannequin to the scene; with a garment open it becomes the garment's avatar. One undo step.
Discard Garment
tb.ops.garment.cancel(*, session_id: str = ..., next: bool = False) -> Result
Discard the open garment and delete the pieces it made (objects it began with stay in the scene); one undo step.
Garment Capabilities
tb.ops.garment.describe() -> Result
List the starter fabrics, the session settings with their defaults and what a garment session supports. Read-only.
Edit Garment
tb.ops.garment.edit(
*,
session_id: str = ...,
panels: Sequence[ObjectRef] = ...,
avatars: Sequence[ObjectRef] = ...,
panel: Any = ...,
outfit: Any = ...,
add_seam: Any = ...,
add_seams: Any = ...,
remove_seam: str = ...,
sew_on: Any = ...,
flip_seam: str = ...,
resew_seam: Any = ...,
add_pin: Any = ...,
remove_pin: str = ...,
add_tack: Any = ...,
remove_tack: str = ...,
add_quilt: Any = ...,
zipper: Any = ...,
remove_quilt: str = ...,
add_line: Any = ...,
pleat_line: Any = ...,
fold_line: Any = ...,
edit_line: Any = ...,
piece_state: Any = ...,
elastic_line: Any = ...,
drawstring_line: Any = ...,
topstitch_line: Any = ...,
topstitch_seam: Any = ...,
remove_line: str = ...,
reference: Any | None = ...,
redrape: bool = ...,
staged: str = ...,
fabric: Literal["cotton", "jersey", "silk", "denim", "wool", "leather", "canvas", "nylon", "hide", "linen", "chiffon", "satin"] = ...,
gravity: float = 9.81,
assembly_frames: int = 90,
drape_frames: int = 150,
seam_strength: float = 1.0,
seam_tolerance: float = 0.03,
iterations: int = 24,
ground_plane: bool = True,
damping: float = ...,
stretch_stiffness: float = 1.0,
weft_stiffness: float = 1.0,
warp_stiffness: float = 1.0,
bias_stiffness: float = 1.0,
bend_stiffness: float = 1.0,
weight: float = 1.0,
fabric_friction: float = 1.0,
self_collision: bool = False,
self_collision_thickness: float = 0.004,
self_collision_iterations: int = 2,
thickness: float = ...,
smooth_levels: int = 1,
weld_seams: bool = True,
lods: int = 0,
wrinkle_map: bool = True,
name: str = ...,
) -> Result
Change the open garment: fabric and settings, panels, avatars, seams, pins, internal lines and the reference image. One undo step, together with the look a piece whose fabric changed now wears.
Apply Fabric Looks
tb.ops.garment.fabric.look(*, pieces: Any = [], fabrics: Any = []) -> Result
Give garment pieces their fabric's look: each piece is bound to the project material named for its fabric ("Denim Fabric"), made with the fabric's color, roughness, sheen and weave (color and normal textures laid along the grain at the weave's real size) the first time it is needed and kept afterwards for editing. The open garment does this itself whenever a piece's fabric changes. Fabrics: cotton, jersey, silk, denim, wool, leather, canvas, nylon, hide, linen, chiffon, satin. One undo step.
Make Panel
tb.ops.garment.make_panel(
*,
curve: ObjectRef = ...,
edge_length: float = 0.02,
keep_curve: bool = False,
name: str = ...,
) -> Result
Turn a closed curve into a flat cloth panel of even quads: the outline keeps its corners, laid flat on its best-fit plane. The curve is replaced unless Keep Curve is on; with Clothing open the panel joins the garment. One undo step.
Add Pattern Pieces
tb.ops.garment.pattern.add(
*,
pieces: Any,
seams: Any = ...,
sew_on: Any = ...,
tacks: Any = ...,
edge_length: float = 0.02,
avatars: Sequence[ObjectRef] = ...,
) -> Result
Turn 2D pattern pieces into flat cloth panels of even quads, laid out in front of the garment's avatar (or at each piece's saved placement), and sew the pattern's seams. With Clothing open the panels join the garment. One undo step.
Arrange Pattern
tb.ops.garment.pattern.arrange(*, places: Any) -> Result
Save where pieces sit in the Pattern Editor, one undo step; the arrangement is kept with the garment in the project and comes back when Clothing opens again.
Cut Pattern Piece
tb.ops.garment.pattern.cut(
*,
node: ObjectRef,
from_: Any = ...,
to: Any = ...,
line: str = ...,
sew: bool = False,
) -> Result
Cut a piece in two along a straight line through it (in its flat frame); the new piece stays where it was, in the same fabric, and seams follow the part they were on. With sew, the two cut sides are sewn back together (Cut & Sew). One undo step for the pieces; seams are garment steps.
Add Dart
tb.ops.garment.pattern.dart(
*,
node: ObjectRef,
side: int,
at: float = 0.5,
width: float = 0.03,
depth: float = 0.08,
) -> Result
Take a dart in from one side of a piece: a V of the given width and depth, its two legs sewn together so the cloth shapes over the body. The piece is one undo step, the dart's seam one garment step.
Grade Pattern
tb.ops.garment.pattern.grade(
*,
nodes: Sequence[ObjectRef] = ...,
width: float = 100.0,
height: float = 100.0,
) -> Result
Grade pattern pieces to another size: each piece grows or shrinks about its center by the width and height percentages in its flat frame, refilled with quads; seams and notches follow the graded sides. One undo step.
Import Pattern
tb.ops.garment.pattern.import_(
*,
data: str,
format: Literal["svg", "dxf"] = "svg",
scale: float = 1.0,
edge_length: float = 0.02,
) -> Result
Read the closed outlines of an SVG or DXF drawing (millimetres, or pixels at 96 dpi) as pattern pieces and add them like Add Pattern Pieces, keeping the drawing's layout. One undo step.
Pattern Library
tb.ops.garment.pattern.library(
*,
id: str = ...,
fit: Literal["slim", "regular", "loose"] = "regular",
length: Literal["short", "regular", "long"] = "regular",
) -> Result
The starting patterns that ship with ToolBox3D (tank top, dress, skirt …): each with its pieces, notches and seams, ready for Add Pattern Pieces and fully editable after.
Merge Pattern Pieces
tb.ops.garment.pattern.merge(*, seam: str) -> Result
Join the two pieces a seam sews into one piece, laid together along the seam: the first piece takes the second's outline, its other seams follow, and the second piece is deleted. One undo step for the pieces; seams are garment steps.
Notch Pattern Piece
tb.ops.garment.pattern.notch(
*,
node: ObjectRef,
at: Any,
remove: bool = False,
) -> Result
Add (or remove) a notch on a cloth panel's outline: a sewing mark at the boundary point nearest the given flat-frame point. Notches show in the Pattern Editor, Sew Edges snaps to them, and they follow reshapes and grading. One undo step.
Offset Pattern Piece
tb.ops.garment.pattern.offset(*, node: ObjectRef, distance: float) -> Result
Grow (or shrink) a piece's outline by a distance all round, corners mitred, the curves kept; its seams follow the moved sides. One undo step.
Quilt Pattern Piece
tb.ops.garment.pattern.quilt(
*,
node: ObjectRef,
style: Literal["channels", "diamond", "tufted"] = "channels",
button: float = 0.02,
spacing: float = 0.08,
sleeve: Any = ...,
loft: float = 0.015,
) -> Result
Quilt a piece: its outline is added again as a lining just inside it, sewn to it round the outline and along quilting lines (parallel channels or diamonds) with the fill puffing each channel up to the loft as it drapes. One undo step for the lining and its stitching.
Read Pattern
tb.ops.garment.pattern.read() -> Result
The open garment's pattern: each panel's flat outline in metres, notches, place in the Pattern Editor, fabric and placement, and the seams as flat boundary segments. Save it and pass it to Add Pattern Pieces to rebuild the garment.
Pattern Reference Image
tb.ops.garment.pattern.reference(
*,
staged: str = ...,
texture: str = ...,
width: float = ...,
centre: Any = ...,
opacity: float = ...,
clear: bool = False,
) -> Result
Show an image behind the Pattern Editor's pieces to trace over (a scanned pattern, a sketch), at a real width in metres; kept in the project. Pass staged (a picked file) or texture, or clear to remove it; width, center and opacity adjust it.
Reshape Pattern Piece
tb.ops.garment.pattern.reshape(
*,
node: ObjectRef,
outline: Any,
curves: Any = ...,
symmetric: bool = False,
mirror_angle: float = 0.0,
before: Any = ...,
keep: Any = ...,
edge_length: float = ...,
) -> Result
Give a flat cloth panel a new outline in its flat frame (the frame Read Pattern reports) and refill it with quads; the panel stays where it is. With Clothing open its seams follow: pass the outline it was edited from as before (point for point) and each seam end keeps its place along the edited sides. One undo step.
Place Tuft
tb.ops.garment.pattern.tuft(*, node: ObjectRef, at: Any, remove: bool = False) -> Result
Hold a quilted piece down to its lining at a point of your choosing (a tuft): the stitched piece vertex nearest the point, off the outline, is sewn to its lining at no length, so the fill puffs round it. With remove, the tuft nearest the point is let go and its fill comes back. One undo step.
Move Placement Point
tb.ops.garment.placement.move(
*,
point: str,
position: Any = ...,
normal: Any = ...,
reset: bool = False,
) -> Result
Move one of the open garment's placement points to a spot on the avatar (or reset it). A garment edit, undone with the garment's own Undo.
Place Pieces
tb.ops.garment.placement.place(
*,
point: str,
nodes: Sequence[ObjectRef] = ...,
offset: float = 0.06,
) -> Result
Put pieces of the open garment at a placement point, facing out from the body (several pieces sit side by side). One undo step.
Placement Points
tb.ops.garment.placement.points() -> Result
The open garment's placement points on its avatar: chest, back, waist, arms and legs, each with its surface position and outward normal (world metres). Read-only.
Refit Garment
tb.ops.garment.refit(
*,
avatars: Sequence[ObjectRef],
grade: bool = True,
carry: bool = False,
) -> Result
Move the open garment onto another character: every piece keeps its place on the body (scaled with its height, width and depth), the pattern is graded by the change in girth and height (quilted pieces are graded and quilted again), placement points you moved follow onto the new body, and the character becomes the garment's avatar, in whatever pose it stands; drape again to settle it. With carry, the drape itself moves onto the new body too, keeping fit and folds. One undo step.
Match Seam Lengths
tb.ops.garment.seam.match(*, seam: str) -> Result
True a seam of the open garment: its second side's piece is reshaped so that side is as long as the first, by moving the corner the sewn side ends on along it; a sewn side that ends mid-side slides its end along the outline instead (a point is added there, the piece keeps its shape). A symmetric piece's other half follows. One undo step.
Drape Garment
tb.ops.garment.simulate(
*,
session_id: str = ...,
action: Literal["drape", "play", "pause", "step", "reset"],
frames: int = 10,
) -> Result
Sew and drape the garment: drape runs the sewing then draping frames from the start, play and pause run it live, step advances, reset returns the flat panels.
Garment State
tb.ops.garment.state(*, session_id: str = ..., include_geometry: bool = False) -> Result
Read the open garment session (null without one): panels, avatars, seams, pins, settings, drape stage and quality (largest seam gap and pin drift).
Bake Topstitching
tb.ops.garment.topstitch_bake(*, material: MaterialRef, staged: str) -> Result
Bake Garment's step that lays the garment's stitched lines into its normal map. Run Bake Garment, which plans the map.
Apply Trim
tb.ops.garment.trim.apply(
*,
trim: Any = ...,
mesh: ObjectRef = ...,
kind: Literal["button", "puller"] = "button",
tacks: Any = ...,
) -> Result
Put a trim on the open garment, one undo step: a button-like trim on its buttons (all of them, or the tacks named), a puller on every zipper. The trim is a Trims Library id, one of the garment's own trims, a {name, kind, positions, faces} object in trim units (a saved trim), or a mesh object of yours with its kind.
Trims Library
tb.ops.garment.trim.library() -> Result
The trims that ship with ToolBox3D: buttons, a snap, a rivet and a toggle (sewn on with a tack's button) and zipper pullers. Each with its id, name, kind (button or puller) and usual size.
Bake Wrinkle Map
tb.ops.garment.wrinkle_map(
*,
material: MaterialRef,
high: ObjectRef = ...,
size: int = 1024,
staged: str = ...,
) -> Result
Bake the folds of a detailed garment into a normal map for a lower-detail copy: the map is projected from the high mesh (with its smoothing) onto the copy's UVs and bound as its material's normal texture. Bake Garment runs it for each LOD. One undo step.