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

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

Add Skin Layer

tb.ops.skincluster.add_layer(
    *,
    mesh: MeshRef = ...,
    name: str,
    mode: Literal["replace"] = "replace",
) -> Result

Add an empty skin layer on top of a mesh's stack and paint it next. A layer's joint weights are its own blend: on each vertex they sum to at most 1 and replace that share of everything below (0 shows what is below, 1 replaces it). Painting a layer never changes the base or the layers below; exports merge the stack into one skin cluster. One undo step.

  • Operation skincluster.add_layer
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Skinned mesh (default: the selected / only one).
namestrrequiredThe layer's name (unique on the mesh).
modeLiteral["replace"]"replace"Mode (replace).

Apply Computed Weights

tb.ops.skincluster.apply_staged(*, tokens: Any) -> Result

Apply weights computed by a background job or a Weight Paint stroke (one undo step). Refused when the mesh changed since the weights were computed.

  • Operation skincluster.apply_staged
  • In Control Rig
ArgumentTypeDefaultDescription
tokensAnyrequiredStaged-weights tokens (tb_api::skin::stage_weights).

Bind Skin

tb.ops.skincluster.bind(
    *,
    meshes: Sequence[MeshRef] = ...,
    joints: Any = ...,
    method: Literal["rigid", "geodesic", "closest_joint", "surface_grid"] = "rigid",
    replace_existing: bool = False,
    max_influences: int = 4,
) -> Result

Bind meshes to the skeleton. Rigid: each mesh follows one joint — the named one or the joint nearest its center. Geodesic Voxel / Closest Joint: smooth automatic weights over every joint. Surface Chains Grid: cloth on a Skirt or Cape grid, each vertex on the four joints of the grid quad it lies on (bilinear), the weights the skirt's leg collision keeps out of the legs. Creates the skin every other weight tool needs; one undo step (with the cloth depth a Surface Chains Grid bind measures). Bind again with replaceExisting to change it.

  • Operation skincluster.bind
  • In Control Rig
ArgumentTypeDefaultDescription
meshesSequence[MeshRef]—Meshes to bind (default: every mesh without a skin).
jointsAny—Rigid: joint names paired positionally with 'meshes' (default: the nearest joint).
methodLiteral["rigid", "geodesic", "closest_joint", "surface_grid"]"rigid"Method (rigid / geodesic / closest_joint / surface_grid).
replace_existingboolFalseReplace Existing.
max_influencesint4Joints per vertex (default: the rig's Max Influences, else 4). (1…8).

Compute Weights

tb.ops.skincluster.compute_weights(
    *,
    meshes: Sequence[MeshRef] = ...,
    method: Literal["geodesic", "skincells", "closest_joint"] = "geodesic",
    quality: Literal["fast", "standard", "best"] = "best",
    max_influences: int = 4,
    resolution: int = 256,
    falloff: float = 0.5,
    smooth_iterations: int = 8,
    skip_outside_joints: bool = True,
    mirror_after: bool = False,
    iterations: int = 300,
) -> Result

Compute automatic skin weights at the bind pose. Geodesic Voxel (recommended) measures distances through the body, so legs, tail and ears never bleed into each other; it handles open, multi-shell and non-manifold meshes. SkinCells fits a compact weight field over random poses. Closest Joint is a simple inverse-distance method. Meshes computed together share one body. Large meshes: run tb_api::skin::ComputeWeightsJob in the background and apply its result with skincluster.apply_staged.

  • Operation skincluster.compute_weights
  • In Control Rig
ArgumentTypeDefaultDescription
meshesSequence[MeshRef]—Skinned meshes (default: the selected skinned meshes, else all).
methodLiteral["geodesic", "skincells", "closest_joint"]"geodesic"Method (geodesic / skincells / closest_joint).
qualityLiteral["fast", "standard", "best"]"best"Fast: the solve alone. Standard / Best: 1 / 3 passes of Delta-Mush refinement (smoother, volume-keeping joints). (fast / standard / best).
max_influencesint4Joints per vertex (default: the rig's Max Influences, else 4). (1…8).
resolutionint256Voxels along the longest axis. (32…1024).
fallofffloat0.50 = rigid joints … 1 = wide, smooth blends. (0…1).
smooth_iterationsint8Smooth Iterations (0…20).
skip_outside_jointsboolTrueIgnore joints whose bone lies outside the body (ground roots, end joints).
mirror_afterboolFalseMirror left → right across X afterwards.
iterationsint300SkinCells optimization steps. (10…5000).

Limit Influences

tb.ops.skincluster.enforce_max_influences(
    *,
    meshes: Sequence[MeshRef] = ...,
    max_influences: int = 4,
) -> Result

Keep at most N influences per vertex (the strongest), renormalized.

  • Operation skincluster.enforce_max_influences
  • In Control Rig
ArgumentTypeDefaultDescription
meshesSequence[MeshRef]—Meshes.
max_influencesint4Max Influences (1…8).

Inspect Skin Weights File

tb.ops.skincluster.inspect_weights_file(*, data: Any) -> Result

What loading a skin-weight file would do, without loading it: per file mesh its vertex count, UVs, the scene mesh it matches by name, and each joint's share of the weight with the bone it maps to (null when no bone matches). The Load Skin Weights dialog shows this.

  • Operation skincluster.inspect_weights_file
  • In Control Rig
ArgumentTypeDefaultDescription
dataAnyrequiredThe file content (JSON object or text).

Load Skin Weights

tb.ops.skincluster.load_weights(
    *,
    data: Any,
    mapping: Literal["auto", "vertex", "position", "uv"] = "auto",
    max_influences: int = 4,
    targets: Any = ...,
    joint_map: Any = ...,
) -> Result

Load a skin-weight JSON file onto meshes: file meshes match by name, joints by name (also case-insensitive and namespace-stripped), vertices by order when the counts match, else by nearest bind position. Meshes without a skin get one.

  • Operation skincluster.load_weights
  • In Control Rig
ArgumentTypeDefaultDescription
dataAnyrequiredThe file content (JSON object or text).
mappingLiteral["auto", "vertex", "position", "uv"]"auto"Mapping (auto / vertex / position / uv).
max_influencesint4Max Influences (1…8).
targetsAny—{ fileMesh: targetMesh (name or id) or null to skip } — file meshes left out match by name (case-insensitive, namespace-stripped).
joint_mapAny—{ fileJoint: bone } for joints whose names do not match.

Mirror Weights

tb.ops.skincluster.mirror_weights(
    *,
    mesh: MeshRef = ...,
    direction: Literal["left_to_right", "right_to_left"] = "left_to_right",
    axis: Literal["x", "y", "z"] = "x",
) -> Result

Mirror skin weights from one side to the other across an axis (vertices paired by position, joints by left / right names).

  • Operation skincluster.mirror_weights
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Mesh.
directionLiteral["left_to_right", "right_to_left"]"left_to_right"Direction (left_to_right / right_to_left).
axisLiteral["x", "y", "z"]"x"Axis (x / y / z).

Normalize Weights

tb.ops.skincluster.normalize(*, meshes: Sequence[MeshRef] = ...) -> Result

Rescale every vertex's weights to sum to 1.

  • Operation skincluster.normalize
  • In Control Rig
ArgumentTypeDefaultDescription
meshesSequence[MeshRef]—Meshes.

Prune Weights

tb.ops.skincluster.prune(
    *,
    mesh: MeshRef = ...,
    threshold: float = 0.01,
    vertices: Any = ...,
) -> Result

Remove weights below a threshold and renormalise (a vertex never loses its last influence).

  • Operation skincluster.prune
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Mesh.
thresholdfloat0.01Threshold (0…1).
verticesAny—Vertex indices or "all" (default: the component selection).

Relax Weights

tb.ops.skincluster.relax(
    *,
    mesh: MeshRef = ...,
    strength: float = 0.5,
    iterations: int = 3,
    max_influences: int = 4,
    vertices: Any = ...,
    locked: Any = ...,
) -> Result

Smooth weights on vertices toward their neighbours (ngSkinTools-style: blends by influence, neighbours are read, not written); locked joints keep their weights.

  • Operation skincluster.relax
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Mesh.
strengthfloat0.5Strength (0…1).
iterationsint3Iterations (1…20).
max_influencesint4Max Influences (1…8).
verticesAny—Vertex indices or "all" (default: the component selection).
lockedAny—Locked joint names (their weights do not change).

Remove Skin Layer

tb.ops.skincluster.remove_layer(*, mesh: MeshRef = ..., layer: str) -> Result

Remove a skin layer and its weights (the base and the other layers stay). One undo step.

  • Operation skincluster.remove_layer
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Skinned mesh (default: the selected / only one).
layerstrrequiredLayer.

Rigidify Weights

tb.ops.skincluster.rigidify(
    *,
    mesh: MeshRef = ...,
    strength: float = 0.5,
    iterations: int = 1,
    max_influences: int = 4,
    vertices: Any = ...,
    locked: Any = ...,
) -> Result

Push weights toward 0 / 1: the dominant influence moves toward 1 and the others toward 0 by Strength per iteration (armour, buckles, buttons). Locked joints keep their weights.

  • Operation skincluster.rigidify
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Mesh.
strengthfloat0.5Strength (0…1).
iterationsint1Iterations (1…20).
max_influencesint4Max Influences (1…8).
verticesAny—Vertex indices or "all" (default: the component selection).
lockedAny—Locked joint names (their weights do not change).

Save Skin Weights

tb.ops.skincluster.save_weights(
    *,
    meshes: Sequence[MeshRef] = ...,
    file_name: str = ...,
) -> Result

Write the skin weights of meshes to a skin-weight JSON file (joint names, weights, bind positions, UVs): the result's 'data' is the file content.

  • Operation skincluster.save_weights
  • In Control Rig
ArgumentTypeDefaultDescription
meshesSequence[MeshRef]—Skinned meshes (default: all).
file_namestr—Suggested file name.

Select Affected Vertices

tb.ops.skincluster.select_affected(
    *,
    mesh: MeshRef = ...,
    influence: str,
    threshold: float = 0.0,
) -> Result

Select the vertices a joint influences (weight above the threshold); switches to vertex selection.

  • Operation skincluster.select_affected
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Mesh.
influencestrrequiredJoint name.
thresholdfloat0.0Threshold (0…1).

Skin Layer Settings

tb.ops.skincluster.set_layer(
    *,
    mesh: MeshRef = ...,
    layer: str,
    rename: str = ...,
    mode: Literal["replace"] = ...,
    view: Literal["show", "hide", "solo"] = ...,
    index: int = ...,
) -> Result

Change a skin layer: rename it, its mode (replace), its view (show; hide to compare with what is below; solo to see it alone over the base) or its place in the stack (index 0 = just above the base). One undo step.

  • Operation skincluster.set_layer
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Skinned mesh (default: the selected / only one).
layerstrrequiredLayer.
renamestr—A new name.
modeLiteral["replace"]—Mode (replace).
viewLiteral["show", "hide", "solo"]—View (show / hide / solo).
indexint—The layer's new place, 0 = bottom.

Skinning Method

tb.ops.skincluster.set_method(
    *,
    meshes: Sequence[MeshRef] = ...,
    method: Literal["linear", "dualQuaternion"],
) -> Result

How the joints blend: Linear, or Dual Quaternion (keeps volume where joints twist and bend).

  • Operation skincluster.set_method
  • In Control Rig
ArgumentTypeDefaultDescription
meshesSequence[MeshRef]—Meshes.
methodLiteral["linear", "dualQuaternion"]requiredMethod (linear / dualQuaternion).

Paint Layer

tb.ops.skincluster.set_paint_layer(*, mesh: MeshRef = ..., layer: str = ...) -> Result

What Weight Paint and the weight tools (set, smooth, prune, mirror, normalize, compute) edit on a mesh: the base weights (layer left out or "base") or one skin layer. On a layer the brush paints its joint weights freely, capped to 1 per vertex. One undo step.

  • Operation skincluster.set_paint_layer
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Skinned mesh (default: the selected / only one).
layerstr—A layer name, or "base".

Set Weight

tb.ops.skincluster.set_weight(
    *,
    mesh: MeshRef = ...,
    influence: str,
    weight: float,
    operation: Literal["replace", "add", "subtract", "scale", "erase"] = "replace",
    strength: float = 1.0,
    min: float = 0.0,
    max: float = 1.0,
    max_influences: int = 4,
    vertices: Any = ...,
    locked: Any = ...,
) -> Result

Set an exact weight for one joint on vertices; the other unlocked influences share the rest proportionally (a sole influence keeps 1.0 — weights stay normalized).

  • Operation skincluster.set_weight
  • In Control Rig
ArgumentTypeDefaultDescription
meshMeshRef—Skinned mesh (default: the selected / only one).
influencestrrequiredJoint name.
weightfloatrequiredWeight (0…1).
operationLiteral["replace", "add", "subtract", "scale", "erase"]"replace"How 'weight' changes the current weight w (Weight Paint's Flood): replace w + (weight − w)·strength, add w + weight·strength, subtract w − weight·strength, scale w·(1 − strength); erase (Smart Erase) takes w·strength away and hands it to the joints the neighbouring vertices use ('weight' is ignored). (replace / add / subtract / scale / erase).
strengthfloat1.0Strength (0…1).
minfloat0.0Clamp lower bound of the result. (0…1).
maxfloat1.0Clamp upper bound of the result. (0…1).
max_influencesint4Joints per vertex an erase may leave (it can bring in the neighbours' joints). (1…8).
verticesAny—Vertex indices or "all" (default: the component selection).
lockedAny—Locked joint names (their weights do not change).

Transfer Weights

tb.ops.skincluster.transfer_weights(
    *,
    sources: Sequence[MeshRef] = ...,
    targets: Sequence[MeshRef] = ...,
    method: Literal["robust", "nearest", "topology", "skincells", "position_falloff", "uv_falloff", "closest_joint"] = "robust",
    max_influences: int = 4,
    distance_ratio: float = 0.05,
    max_angle: float = 30.0,
    allow_flipped_normals: bool = False,
    inpaint: Literal["biharmonic", "harmonic"] = "biharmonic",
    smooth_iterations: int = 10,
    rigid_accessories: bool = False,
    accessory_size: float = 0.12,
    rigid_props: bool = True,
    unmatched_shells: Literal["nearest", "rigid"] = "nearest",
    far_field: bool = False,
    max_distance: float = 0.2,
    falloff_distance: float = 0.1,
    iterations: int = 300,
) -> Result

Transfer skin weights from skinned source meshes onto target meshes (which need not be skinned yet). Robust (recommended) matches each target vertex to the source surface it lies on — by distance and normal — and fills the rest smoothly, so open meshes, separate parts, layered clothing and LoDs transfer cleanly; it records a per-vertex confidence for the viewport. Nearest copies the closest surface everywhere; SkinCells fits a weight field; the falloff modes blend into the existing weights with a distance falloff.

  • Operation skincluster.transfer_weights
  • In Control Rig
ArgumentTypeDefaultDescription
sourcesSequence[MeshRef]—Skinned source meshes (default: every skinned mesh that is not a target).
targetsSequence[MeshRef]—Target meshes (default: the selected meshes).
methodLiteral["robust", "nearest", "topology", "skincells", "position_falloff", "uv_falloff", "closest_joint"]"robust"Method (robust / nearest / topology / skincells / position_falloff / uv_falloff / closest_joint).
max_influencesint4Max Influences (1…8).
distance_ratiofloat0.05Robust: match distance as a fraction of the character's size (the larger of the source and target). (0…10).
max_anglefloat30.0Robust: largest normal deviation for a match (degrees). (0…180).
allow_flipped_normalsboolFalseRobust: also match surfaces facing the other way (single-sided cloth).
inpaintLiteral["biharmonic", "harmonic"]"biharmonic"Inpaint (biharmonic / harmonic).
smooth_iterationsint10Smooth Iterations (0…100).
rigid_accessoriesboolFalseBind small separate shells (buttons, buckles, jewellery) rigidly to their dominant joint.
accessory_sizefloat0.12Accessory Size (0…1).
rigid_propsboolTrueBind props rigidly: a separate part that touches the body over a small area and reaches far from it (a sword in a hand, a shield on an arm) follows the joint it touches as one piece.
unmatched_shellsLiteral["nearest", "rigid"]"nearest"Unmatched Shells (nearest / rigid).
far_fieldboolFalseRobust: fill parts far from the source (trouser legs over a body without legs, a coat skirt) with a weight field fitted to the source (SkinCells) instead of stretching the nearest weights over them. Takes a few seconds more.
max_distancefloat0.2Falloff modes: largest transfer distance (world units; UV units in UV mode).
falloff_distancefloat0.1Falloff modes: blend band.
iterationsint300SkinCells: optimization steps. (10…5000).

Transfer Weights from Active Mesh

tb.ops.skincluster.transfer_weights_from_selected(
    *,
    method: Literal["robust", "nearest", "topology", "skincells", "position_falloff", "uv_falloff", "closest_joint"] = "robust",
    max_influences: int = 4,
    distance_ratio: float = 0.05,
    max_angle: float = 30.0,
    allow_flipped_normals: bool = False,
    inpaint: Literal["biharmonic", "harmonic"] = "biharmonic",
    smooth_iterations: int = 10,
    rigid_accessories: bool = False,
    accessory_size: float = 0.12,
    rigid_props: bool = True,
    unmatched_shells: Literal["nearest", "rigid"] = "nearest",
    far_field: bool = False,
    max_distance: float = 0.2,
    falloff_distance: float = 0.1,
    iterations: int = 300,
) -> Result

Transfer weights from the active (skinned) mesh to every other skinned mesh.

  • Operation skincluster.transfer_weights_from_selected
  • In Control Rig
ArgumentTypeDefaultDescription
methodLiteral["robust", "nearest", "topology", "skincells", "position_falloff", "uv_falloff", "closest_joint"]"robust"Method (robust / nearest / topology / skincells / position_falloff / uv_falloff / closest_joint).
max_influencesint4Max Influences (1…8).
distance_ratiofloat0.05Robust: match distance as a fraction of the character's size (the larger of the source and target). (0…10).
max_anglefloat30.0Robust: largest normal deviation for a match (degrees). (0…180).
allow_flipped_normalsboolFalseRobust: also match surfaces facing the other way (single-sided cloth).
inpaintLiteral["biharmonic", "harmonic"]"biharmonic"Inpaint (biharmonic / harmonic).
smooth_iterationsint10Smooth Iterations (0…100).
rigid_accessoriesboolFalseBind small separate shells (buttons, buckles, jewellery) rigidly to their dominant joint.
accessory_sizefloat0.12Accessory Size (0…1).
rigid_propsboolTrueBind props rigidly: a separate part that touches the body over a small area and reaches far from it (a sword in a hand, a shield on an arm) follows the joint it touches as one piece.
unmatched_shellsLiteral["nearest", "rigid"]"nearest"Unmatched Shells (nearest / rigid).
far_fieldboolFalseRobust: fill parts far from the source (trouser legs over a body without legs, a coat skirt) with a weight field fitted to the source (SkinCells) instead of stretching the nearest weights over them. Takes a few seconds more.
max_distancefloat0.2Falloff modes: largest transfer distance (world units; UV units in UV mode).
falloff_distancefloat0.1Falloff modes: blend band.
iterationsint300SkinCells: optimization steps. (10…5000).

Transfer Weights to Active Mesh

tb.ops.skincluster.transfer_weights_to_selected(
    *,
    method: Literal["robust", "nearest", "topology", "skincells", "position_falloff", "uv_falloff", "closest_joint"] = "robust",
    max_influences: int = 4,
    distance_ratio: float = 0.05,
    max_angle: float = 30.0,
    allow_flipped_normals: bool = False,
    inpaint: Literal["biharmonic", "harmonic"] = "biharmonic",
    smooth_iterations: int = 10,
    rigid_accessories: bool = False,
    accessory_size: float = 0.12,
    rigid_props: bool = True,
    unmatched_shells: Literal["nearest", "rigid"] = "nearest",
    far_field: bool = False,
    max_distance: float = 0.2,
    falloff_distance: float = 0.1,
    iterations: int = 300,
) -> Result

Transfer weights from every other skinned mesh to the active mesh.

  • Operation skincluster.transfer_weights_to_selected
  • In Control Rig
ArgumentTypeDefaultDescription
methodLiteral["robust", "nearest", "topology", "skincells", "position_falloff", "uv_falloff", "closest_joint"]"robust"Method (robust / nearest / topology / skincells / position_falloff / uv_falloff / closest_joint).
max_influencesint4Max Influences (1…8).
distance_ratiofloat0.05Robust: match distance as a fraction of the character's size (the larger of the source and target). (0…10).
max_anglefloat30.0Robust: largest normal deviation for a match (degrees). (0…180).
allow_flipped_normalsboolFalseRobust: also match surfaces facing the other way (single-sided cloth).
inpaintLiteral["biharmonic", "harmonic"]"biharmonic"Inpaint (biharmonic / harmonic).
smooth_iterationsint10Smooth Iterations (0…100).
rigid_accessoriesboolFalseBind small separate shells (buttons, buckles, jewellery) rigidly to their dominant joint.
accessory_sizefloat0.12Accessory Size (0…1).
rigid_propsboolTrueBind props rigidly: a separate part that touches the body over a small area and reaches far from it (a sword in a hand, a shield on an arm) follows the joint it touches as one piece.
unmatched_shellsLiteral["nearest", "rigid"]"nearest"Unmatched Shells (nearest / rigid).
far_fieldboolFalseRobust: fill parts far from the source (trouser legs over a body without legs, a coat skirt) with a weight field fitted to the source (SkinCells) instead of stretching the nearest weights over them. Takes a few seconds more.
max_distancefloat0.2Falloff modes: largest transfer distance (world units; UV units in UV mode).
falloff_distancefloat0.1Falloff modes: blend band.
iterationsint300SkinCells: optimization steps. (10…5000).