Part of the Wrangle reference. Everything on this page goes in the node's Code field, and runs once per element of the current Run Over mode.
Skin weights
Default profile on the mesh's real skin attribute - not a tagged @attribute.
| Syntax | What it does | Example |
|---|---|---|
numbones() / numbones("Pin") |
Bone-table count of the subject mesh, or of the named donor mesh pin. Legal in every run-over. | wmap("Weights") = numbones() |
boneweight (pin) / weight (pin) boneweight("Pin", "Bone", i) / weight("Pin", "Bone", i) |
Weight of the named bone at donor vertex i (glob sums). Bone is resolved against that pin's skeleton. Legal in every run-over. Out-of-range i returns 0 and is counted. | wmap("Weights") = weight("Donor", "jaw", ptnum) |
boneweighti / weighti boneweighti(k) / weighti(k) |
Current-vertex weight by bone index. Out-of-range -> 0 + counted. Vertex or Corner domain (a read). | wmap("Weights") = weighti(0) |
bonepos("Bone") / bonepos("Pin", "Bone") |
Component-space bind-pose origin of the named bone, as a vector. Legal in every run-over (needs a skeleton). | vector o = bonepos("root") |
boneaxis("Bone", i) / boneaxis("Pin", "Bone", i) |
Component-space bind-pose axis i in {0,1,2} (X/Y/Z). | vector x = boneaxis("root", 0) |
bonelength("Bone") |
Bind-pose distance from the named bone to its parent. 0 for the root bone (no parent to measure against), and that 0 is counted - self mesh only, no "Pin" form. | wmap("Weights") = bonelength("upperarm_l") |
boneparentpos("Bone") |
The named bone's parent's bind-pose component-space origin, as a vector - the bone's own position for the root (there is a legitimate answer there, unlike bonelength). Self mesh only. | vector p = boneparentpos("hand_l") |
numinfluences() |
How many influences the current vertex currently carries (working copy). Vertex or Corner domain (a read - see setboneweight's own note on why writes stay Vertex-only). | wmap("Weights") = numinfluences() |
influencebone(k) |
Bone index of the k-th influence; out-of-range k returns -1 and is counted. Vertex or Corner domain (a read). | float b = influencebone(0) |
influenceweight(k) |
Weight of the k-th influence; out-of-range k returns 0 and is counted. Vertex or Corner domain (a read). | wmap("Weights") = influenceweight(0) |
clearinfluences() |
Drop every influence on this vertex's working copy. Later setboneweight calls in the same element still apply. Statement-OK. Vertex domain only - a write, same reason setboneweight stays out of Corner. | clearinfluences(); setboneweight("jaw", 1) |
| working copy | Reads and writes go through a per-element working copy seeded from the mesh before the expression runs and written back after, so reading boneweight after setboneweight in the same element sees the write - the same sequential semantics as reading P after writing P. | setboneweight("a", 1); clearinfluences(); setboneweight("b", 1) |
| not @skin | Skin weights are not a tagged named attribute. There is no @skin and no generic attribute buffer - the mesh's own Default skin-weight profile is the only store. |
boneweight("Bone") / weight("Bone")
Current-vertex weight for the named bone on the Default skin-weight profile; 0 when that bone has no influence. Bone name is a string literal resolved at compile time (case-insensitive). A literal containing * is a glob (case-insensitive): matching bones are summed. Zero matches is a compile error listing present names. Vertex or Corner domain (a read - the owning vertex, in Corner). Not a tagged @attribute - Paint/Transfer/Poser/FBX read the same Default profile.
wmap("Weights") = weight("root"); wmap("Weights") = weight("thigh_*")
setboneweight("Bone", w)
Write weight for the named bone on the current vertex. w <= 0 removes that bone from the working copy. Always renormalises with Always-normalize on apply; max 12 influences. Statement-OK. Vertex domain only - a write needs exactly one current vertex, and several corners can share one, so this stays out of Corner mode even though the reads above are legal there. Does not invent new bones - compile-time names only. A glob (*) is a compile error (ambiguous).
clearinfluences(); setboneweight("root", 1)
Viewport
| Syntax | What it does | Example |
|---|---|---|
setcamera("front") / setcamera("front", "source") |
Jump to a framed, axis-aligned view of the whole mesh. Presets: front, back, left, right, top, bottom, three_quarter_left, three_quarter_right. Optional second string is the pane ("source" or "target", default source). Needs mesh bounds - returns 0 with none. | setcamera("front"); setcamera("three_quarter_left", "source") |
orbitcamera(yaw, pitch) |
Relative orbit around the current pivot, in degrees. | orbitcamera(30, 0) |
dollycamera(d) |
Relative move toward(-)/away(+) along the view, in world units. | dollycamera(-10) |
framecamera() |
Refit the whole preview mesh at the current angle. | framecamera() |
setviewmode("lit") |
Restyle both panes: "lit", "unlit" or "wireframe". | setviewmode("unlit") |
captureviewport("C:/path/shot.png") |
Write an offscreen PNG/JPEG of the source pane to that path (literal or chs()). Returns 0 when there is no GPU or the write failed. | captureviewport("C:/path/shot.png") |
selected() |
1 if the current vertex is in the viewport mask (painted selection), else 0. Vertex or Corner only (the owning vertex, in Corner). A compile error in Triangle/Texel/Detail: selected() needs a current vertex. | if (selected()) { Cd = vec3(1, 0, 0) } |
What it is
setcamera/orbitcamera/dollycamera/framecamera/setviewmode/captureviewport drive the live preview camera, shading and an offscreen screenshot - the same capabilities the agent tools set_camera / set_view_options / frame_camera / capture_viewport already have. Once per Run in every Run Over. In Once (Detail) they run through the expression (nested ifs legal). In Vertex/Triangle/Corner/Texel they are legal only as top-level statements and run once on the game thread before the per-element loop; nested inside if/for/while/foreach is a compile error. No Mesh pin is required. Each call returns 1 on success or 0 when there is no preview scene / no mesh for a preset / a capture failed; the run is not aborted. Statement-OK.
setcamera("front")