Print view · Parameters · 1 pageChoose "Save as PDF" as the destination in the print dialog.
Back to the docs

Mesh Morpher documentation

Parameters

1 page · exported 2026-09-06 · https://meshmorpher.com/docs/studio-and-graph/geometry/wrangle/parameters

Studio and Graph › Geometry › Wrangle

Parameters

The inputs you declare on the node: floats, vectors, weight maps, ramps, transforms and deltas. These are inputs you define on the node, not attributes on the mesh.

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.

Syntax What it does Example
bare read paramName Read a user-defined parameter by its bare name; a local of the same name shadows it. Type follows the parameter: Float/Int/Bool read as a scalar, Vector as a vector. wmap("Weights") = radius * 2
ch / chf ch("name") or chf("name") Read a Float parameter by name as a float: the name is a compile-time string (see strings on the Language and control flow page), not code. Both are the same function. wmap("Weights") = ch("strength") * mask
chv("name") Read a vector parameter by name. P += chv("offset")
chi("name") A parameter read truncated toward zero (same rule as trunc()). wmap("Weights") = chi("octaves")
chb("name") A parameter read as a boolean: 0 stays 0, anything else becomes 1. if (chb("enabled")) { wmap("Weights") = 1 }
read only Parameters are inputs, not variables, and cannot be assigned. Copy one into a local first if you need to change it. float r = radius; r *= 2

chs("Name")

Read a String parameter's text, resolved entirely at compile time - legal anywhere a string literal (a name/pin argument) is legal: donor mesh/texture/landmark/weight-map/bone names, chramp/chm/geodist/getattrib/setattrib, even ch()'s own argument. An empty parameter value, or a name that does not match any declared String parameter, is a compile error naming the parameter. This node recompiles every Run, so editing the parameter's value and re-running is exactly the same as editing the literal by hand.

float t = ch(chs("CurveParamName"))

Same name

A Parameter and a User Output may now share the same name - they are two separate pin namespaces (an input list and an output list). A read (bare name, ch()/chf()/chv()/chi()/chb(), or a donor mesh/texture/landmark/weight-map/delta function's pin-name argument) always resolves the input of that name; setoutput() always resolves the output.

(Parameters: Float "Body"; User Outputs: Float "Body") - ch("Body") reads the input, setoutput("Body", x) writes the output

Primary

Every one of these resolves to exactly one declared parameter/output of its type, the same way: the subject (a Mesh parameter - what P/N/Cd/uv/@attrs/the run-over/neighbours/relax/geodist/the detail constants and the bare "Mesh" alias on the Donor mesh pins page all bind to), the mask (a WeightMap parameter - mask, Restrict = Mask, mm.mask), the result (a Mesh User Output - what the node actually publishes), and its Texture, Landmarks and Delta User Outputs (the Texel image and the Detail landmark/delta working sets each publish to whichever one of that type is Primary). WeightMap User Outputs are the one exception - wmap("Name") = ... and mm.set_wmap("Name", buf) both write any declared one by name, Primary or not (Primary only decides which output aliases the fast register-file slot the old single-Weights-output form used - a compile-time detail, invisible to the script). With exactly one candidate of a type, it is automatically that role; declare a second one of the same type and flag one of them Primary in the pin editor, or a node warning names which extra one(s) it ignored.

(Parameters: Mesh "Body" Primary, Mesh "Cage") - Body is the subject; Cage is read only through the donor mesh functions, by name

Weight maps

Parameters list, type Weight Map.

WeightMap parameter

Add a Parameter of type Weight Map and it becomes an input Weight Map pin named as the param - no name is reserved (see same name/primary in the Parameters section above). Name one "Mask" (or flag it Primary if you declare more than one) to make it the mask the mask/Restrict/mm.mask machinery reads. No bare-read form: read any of them through wmap() by pin name.

Parameters list, type Weight Map, name "Falloff"

wmap("Name")

Current-vertex weight from that pin (0 if the vertex id is out of range). Vertex or Corner domain (the owning vertex, in Corner). Missing/unconnected pin is a compile error: No weight map input named X is connected. As an rvalue this always reads the named WeightMap input; used as an assignment target (wmap("Name") = ...) it writes the output of that name instead (see wmap (write) on the Channels and attributes page) - when an input and an output share a spelling, a read binds the input and a write binds the output.

wmap("Weights") = wmap("Falloff")

Wmap (index) - wmap("Name", i)

Weight at vertex i from that pin (self map). Legal in any domain that has meaning for an index.

wmap("Weights") = wmap("Falloff", ptnum)

Ramp parameter

Parameters list, type Ramp - value-only, no pin.

Ramp parameter

Add a Parameter of type Ramp and edit its keys in the pin editor - no pin is ever created, since a ramp has no wire to accept. Two keys, (0,0) and (1,1), the first time it is added.

Parameters list, type Ramp, name "Falloff"

chramp("Name", t)

Baked 256-sample lookup into the named Ramp's curve: t is clamped to [0,1], the value is linearly interpolated between the two nearest keys (constant outside the authored range, which the clamp already guarantees). Legal in every run-over - a ramp is independent of what the program is iterating over, exactly like a Parameter's bare read. Unknown name is a compile error listing the ramp parameters that do exist.

wmap("Weights") = chramp("Falloff", d / 50)

String parameter

Parameters list, type String - value-only, no pin.

String parameter

Add a Parameter of type String and type its text in the pin editor - no pin is ever created, since a string has no wire to accept (same shape as Ramp above). Read it with chs("Name") - see that entry in the Parameters section above for the full rule (legal anywhere a string literal is legal; recompiles every Run). Empty value is a compile error naming the parameter.

Parameters list, type String, name "TargetAttr"

Transform parameter

Parameters list, type Transform.

Transform parameter

Add a Parameter of type Transform and it becomes an input Transform pin named as the param, exactly like Apply Rigid Transform's own Transform pin. Unwired, chm() uses the parameter's own inline location/rotation/scale default instead of erroring - there is no "not connected" case for this type.

Parameters list, type Transform, name "Placement"

chm("Name")

The named Transform parameter as a matrix4 - wired pin wins, else the inline default. Feed it straight to ptransform/vtransform/ntransform/invert/transpose like any other matrix. Legal in every run-over.

P = ptransform(P, chm("Placement"))

Deltas

Parameters list, type Delta - per-vertex offsets by vertex id.

Syntax What it does Example
numdeltas("Pin") How many vertex entries the named pin carries. wmap("Weights") = numdeltas("Sculpt")
hasdelta("Pin", i) 1 if vertex i has an entry in the named pin, else 0. if (hasdelta("Sculpt", ptnum)) { P += delta("Sculpt", ptnum) }
delta("Pin", i) The offset stored for vertex i, as a vector - the zero vector when i has no entry. Absence is a legitimate answer, not a guarded fallback: use hasdelta() first if you need to tell "no entry" apart from "an entry of exactly zero". P += delta("Sculpt", ptnum)
cleardeltas() Empties the Detail run's working delta set. Detail Run Mode only. Usable as a bare statement. cleardeltas()
setdelta(i, v) Upserts vertex i's offset in the working set - overwrites it if i already has one, inserts it otherwise. Detail Run Mode only. Usable as a bare statement. setdelta(0, vec3(0, 0, 1))
removedelta(i) Removes vertex i's entry, if it has one. Detail Run Mode only. Usable as a bare statement. removedelta(0)

Delta parameter

Add a Parameter of type Delta and it becomes an input Delta pin named as the param, exactly like Apply Deltas (Topo Match)'s own Delta pin. No bare-read form - read it through the functions below, by pin name in quotes. Missing/unconnected pin is a compile error: No Delta input named X is connected.

Parameters list, type Delta, name "Sculpt"

Working set / output

The working set starts as a copy of the first wired Delta parameter (Parameters-list order), or empty if none is wired - the same rule Detail's landmark working set follows. After a successful Detail run it publishes on this node's primary Delta output if one exists (see primary above) - Create pins from code (or the pin editor) adds one when the expression writes deltas; switching Run Mode does not.

cleardeltas(); setdelta(0, vec3(0, 0, 1))