/ meshController v1.0 · Maya 2023+

meshController

Production-grade surface pinning, mesh surface binding, and VP2 control toolset for Maya.

Author Zhenggang Deng
Platform Windows · Maya 2023+
Node ID base 0x00140542–7
Parallelism TBB (parallel evaluation)

Introduction

meshController is a Maya C++ plugin that provides high-performance surface pinning and mesh deformation tooling for production facial and character rigging. It ships six node types and five commands targeting two core workflows:

  • Surface Pin — bind any number of rig controls to a deforming mesh surface so that they track position, orientation, and twist precisely, with full undo/redo and parallel evaluation via TBB. A core advantage is the localInverseMatrix input, which solves the double-transform problem inline — no extra utility nodes required when the pin drives offset controls in a facial rig hierarchy. The node also preserves the current transform offset at bind time, so controls retain their authored pose.
  • vertexWrap — a lightweight deformer that snaps split or matching-topology meshes directly to a driver mesh via one-to-one vertex mapping. Designed for large numbers of small individual control shapes; benefits significantly from Maya's parallel evaluation manager.
  • Viewport Tooling — a custom VP2 locator (shapeControl), a mesh surface overlay (meshControlOverlay), and an interactive placement mode (meshControlMode).
Plugin filename The compiled plugin registers under the filename meshController.mll. Load it via the Maya plug-in manager or with cmds.loadPlugin("meshController").

Node Summary

deformer node

vertexWrap

Lightweight deformer for split or matching-topology meshes. One-to-one vertex mapping, no proximity search at eval time — driven vertices are directly snapped to their mapped driver positions.

dependency node

surfacePin

Barycentric surface follower. Drives offsetParentMatrix or translate on any number of controls. TBB-parallelized.

dependency node

surfaceUVPin

UV-space variant of surfacePin. Pin positions are defined by UV coordinates and survive topology changes that preserve UV layout.

locator node

shapeControl

VP2 custom locator with mesh/curve display, hover highlighting, transform readout slider, and configurable draw style.

locator node

meshControlOverlay

Draws a real-time mesh overlay and hover marker in the viewport, used as feedback during interactive meshControlMode.

command

meshControlMode

Activates interactive mesh-surface placement mode with Qt mouse-move hit testing and viewport overlay feedback.

Quick Start

  • 1

    Load the plugin. All nodes and commands become available immediately.

    import maya.cmds as cmds
    cmds.loadPlugin("meshController")
  • 2

    vertexWrap — select the driver mesh first, then one or more split-topology target meshes, and run. Each target vertex snaps to its closest driver vertex at bind time.

    cmds.select(['face_driver_GEO', 'ctrl_mesh_A', 'ctrl_mesh_B'])
    cmds.vertexWrap()
  • 3

    surfacePinBind — position your controls at bind pose, select the mesh followed by the controls, then bind. maintainOffset preserves the current world transform; inverse cancels the control's own local TRS to avoid double-transform in a facial rig hierarchy.

    cmds.select(['head_GEO'] + cmds.ls('lip_ctrl_*'))
    cmds.surfacePinBind(maintainOffset=True, inverse=True)
    
    # Append more controls to the same node later
    cmds.select(['head_GEO', 'brow_ctrl_L'])
    cmds.surfacePinBind(node='surfacePin1', maintainOffset=True, inverse=True)
  • 4

    surfaceUVPinBind — same workflow as surfacePinBind but pins are stored in UV space. Prefer this when the driver mesh topology may change during production but its UV layout stays stable.

    cmds.select(['head_GEO'] + cmds.ls('cheek_ctrl_*'))
    cmds.surfaceUVPinBind(maintainOffset=True)
  • 5

    shapeControlCreate — select a mesh or curve to use as the control shape, then run. Baked mode copies the shape once (fastest); live mode keeps it connected to the source and follows deformation.

    cmds.select('my_ctrl_curve')
    cmds.shapeControlCreate()             # baked, fastest, does not follow deformation
    cmds.shapeControlCreate(live=True)   # follows source deformation, heavier
  • 6

    meshControlMode — interactive viewport mode that tracks split-topology control meshes bound to a vertexWrap node. Select the driver and target meshes, then bind to the node to start tracking:

    cmds.select('driverA', 'a', 'b', r=True)
    cmds.meshControlMode(bind='driverA_vertexWrap')
    # Primary on/off
    cmds.meshControlMode(enable=True)       # enable / refresh tracking from mesh selection
    cmds.meshControlMode(enable=False)      # disable mode
meshControlMode vs shapeControl — which to use
shapeControlmeshControlMode
What it isReal selectable control shape, one node per controlBatched overlay system, single draw node for many controls
Best forFinal rig controls, static icons, individual controls needing unique appearanceMany live deforming mesh controls, hover detection, driver/driven setups
Live costPer-locator VP2 cost every frame — degrades with countSingle overlay node — no per-mesh draw call overhead

⚠ Avoid using 50+ shapeControlCreate(live=True) controls. For large live sets, meshControlMode / meshControlOverlay is the correct performance path.

Manager UI

A single window that consolidates all plugin commands — tracking, display, binding, and pinning — without needing to run commands manually. Open it with:

import meshControlManagerUI
meshControlManagerUI.show()
The UI auto-reactivates meshControlMode on open if tracked meshes already exist in the scene (e.g. after reopening Maya). The refresh button in the status bar refreshes the tracked mesh list and status, and reactivates the viewport mode if tracked meshes exist.

Status Bar

A color-coded dot at the top of the window shows the current mode state at a glance:

ColorMeaning
● RedPlugin commands unavailable — plugin not loaded
● GreyNot initialized — overlay node does not exist yet
● YellowEnabled but no meshes tracked
● GreenActive — shows count of currently tracked meshes

Tracked Meshes

Lists all meshes currently tracked by meshControlMode. Double-clicking a row selects that mesh in the Maya viewport.

ButtonAction
Track SelectedStart tracking the current Maya mesh selection. Becomes Replace Tracking with a confirmation prompt when meshes are already tracked.
Add TrackingAppend currently selected Maya meshes to the tracked list.
RemoveRemove the list-selected rows from tracking.
SelectSelect the list-selected meshes in the Maya viewport.
Clear TrackingStop tracking all meshes. Requires confirmation.
DisableTurn off meshControlMode without removing mesh metadata — tracking can be restored with Track Selected or the refresh button.

Click Target

Controls the meshControlSelectParent attribute on the meshes selected in the list. When checked, clicking that mesh's overlay patch in the viewport selects its parent transform instead of the mesh itself. Supports tristate when multiple rows with mixed values are selected.

If the mesh has a transform connected to its meshControlSelectNode attribute via a message connection, that connected transform is always selected on click — regardless of whether meshControlSelectParent is on. meshControlSelectNode takes priority in the resolution order.

Overlay Display

Three toggles that update the meshControlOverlay node draw attributes live:

ToggleEffect
X-RayDraw overlay patches in x-ray mode, visible through occluding geometry.
WireDraw overlay patches as wireframe instead of solid.
MarkerShow the hover hit marker where the ray-cast lands on the surface.

Build

Shortcut buttons for creating nodes. All respect the current Maya selection.

ButtonAction
VertexWrapSelect driver first, then driven patches. Creates a vertexWrap deformer and immediately starts tracking the driven meshes.
ShapeControl BakedCreates a baked shapeControl from the selected mesh or curve. Fastest — no live connection.
ShapeControl LiveCreates a live shapeControl that follows source deformation. Heavier — use sparingly.

Pin

Creates surface pin binds from the current Maya selection (mesh first, then controls). Options apply to both pin types where supported:

ControlDescription
Surface PinRuns surfacePinBind with the current option values.
Surface UV PinRuns surfaceUVPinBind. Inverse and Output options do not apply.
Surface Pin OutputDropdown — Matrix connects to offsetParentMatrix; Translate connects translate channels only.
Maintain OffsetPreserves each control's current world transform at bind time. On by default.
InverseCancels the control's own local TRS to avoid double-transform in a facial rig hierarchy.

vertexWrap Node

vertexWrap is a MPxDeformerNode designed for split or matching-topology meshes. At bind time it computes a one-to-one vertex mapping from each driven mesh to the driver. At evaluation time there is no proximity search, no weight solve, and no barycentric interpolation — it reads the current driver points and directly writes each driven vertex to its mapped driver position, scaled by the deformer envelope. This makes it the minimal-cost option whenever topology correspondence already exists.

Driver point reads are cached per evaluation cycle behind a mutex; per-vertex write work is lockless, so the deformer scales cleanly under Maya's parallel evaluation manager (EMP).

No GPU override — and that's intentional vertexWrap does not implement MPxGPUDeformer. The typical use case is a large number of small, individual meshes (e.g. split-topology face control shapes) each snapping to a region of the main driver mesh. Uploading many tiny meshes to the GPU per frame has more overhead than it saves. Instead, the deformer gets its performance win from Maya's parallel evaluation manager — each target mesh is an independent output that EMP can schedule concurrently, which is why the benchmark shows a 1.73× throughput gain in EMP mode vs. DG with no GPU involved at all.

Attributes

Long NameShortTypeDescription
inMeshimkMeshDriver mesh world geometry input.
mappingmpkIntArrayPer-target-vertex driver vertex index. Computed at bind time; one integer per driven vertex.

Performance

Evaluation-time comparison against Maya's built-in proximityWrap (surface and snap modes) and the legacy wrap deformer. Test scene: split-topology mesh controls bound to a deforming face geometry driver. Timing measured over multiple playback passes; DG, EMS, and EMP modes recorded separately.

Use cases & limitations The primary use case is mesh-control snap: driving a set of split-topology control meshes so they conform precisely to the deforming surface without any sliding or interpolation. Because the deform loop is a plain indexed copy, it scales linearly with vertex count and parallelises trivially — the EMP (parallel evaluation) column shows a 1.73× throughput gain over DG on the same hardware, whereas proximityWrap in surface mode actually regresses in EMP (51.7 vs 72.1 fps DG) due to internal locking on its proximity structures. The trade-off is that vertexWrap requires a fixed vertex correspondence and cannot handle arbitrary topology or sliding offset deformation — for those cases proximityWrap is the appropriate choice.
Playback speed by evaluation mode — fps (higher is better)
Average evaluation time — ms / frame (lower is better)

Detailed results

Deformer Avg ms/frame Median ms/frame Avg fps DG fps EMS fps EMP fps
vertexWrap 10.8510.82 92.1 84.375.4 145.6
proximityWrap (snap) 14.0614.01 71.1 74.661.2 63.0
proximityWrap (surface) 15.8315.73 63.2 72.151.9 51.7
wrap 31.6531.46 31.6 30.724.7 57.5
⚠ proximityWrap parallel regression proximityWrap in surface mode drops from 72.1 fps (DG) to 51.7 fps (EMP) — a 28% regression under parallel scheduling. Snap mode shows a smaller but similar pattern (74.6 → 63.0 fps). This indicates internal contention on shared proximity data structures that prevents effective parallelism. In rigs with many proximityWrap nodes, forcing DG evaluation may produce higher throughput than EMP.

vertexWrap Command

Creates a vertexWrap deformer and computes the vertex mapping for all selected target meshes. Select the driver mesh first, then one or more target meshes.

# Select driver first, then targets
cmds.select(['driver_GEO', 'target_A', 'target_B'])
cmds.vertexWrap()

# Optional: name the node
cmds.vertexWrap(name='face_vertexWrap')
Topology requirement The driven mesh must have a matching or split vertex layout relative to the driver — each driven vertex is mapped to its spatially closest driver vertex at bind time. If the meshes have substantially different densities, use proximityWrap instead.

surfacePin Node

surfacePin is a MPxNode that reads a deforming mesh each frame and outputs a world-space 4×4 matrix per control, derived from the mesh surface at the control's stored bind position. The orientation encodes the local TBN frame: X = tangent, Y = bitangent, Z = surface normal.

Bind data (barycentric weights, vertex indices, tangent coefficients) is baked at bind time by surfacePinBind and stored in storable attributes. At runtime, only the deformed mesh positions are read — no closet-point searches occur per frame.

How the surface frame is built

For each control i per compute frame:

  1. Interpolate mesh position using stored barycentric weights over 3 triangle vertices → world position.
  2. Reconstruct a smooth normal by blending per-vertex local-topology normals (vertex ring averages) at the 3 triangle corners.
  3. Reconstruct the tangent from stored edge-relative coefficients (a·edge₀ + b·edge₁), projected onto the normal plane. This prevents world-space drift as the mesh deforms.
  4. Compute bitangent as N × T. Assemble the 4×4 matrix.
  5. Optionally apply the stored bind offset (for -maintainOffset mode) via pre-/post-multiply of bind inverse and bind control matrices.
  6. Apply parent-inverse and/or control-inverse compensation if connected.

The TBB parallel_for loop runs over all N controls simultaneously when parallel evaluation is active.

Attributes

Per-Frame Inputs

Long NameShortTypeR/WDescription
deformedGeometrydgkMeshinputConnect to meshShape.worldMesh[instance]. The deforming mesh positions read each frame.
geometryWorldMatrixgwmkMatrixinputConnect to meshShape.worldMatrix[instance]. Transforms barycentric-interpolated positions into world space. Required when the mesh has a non-identity world transform.
controlParentInverseMatrix[]cpimkMatrix[]inputArray of parent worldInverseMatrix per control, one entry per control index. Used to convert world-space output into parent space.
controlLocalInverseMatrix[]climkMatrix[]inputArray of the control's own inverseMatrix. Connected only in -inverse mode to cancel the control's own local transform.

Stored Bind Data (Storable)

Long NameShortTypeDescription
baryWeightsbwkDoubleArrayBarycentric weights, 3 per control, flat array of length N×3.
vertexIndicesvikIntArrayMesh vertex indices for the 3 triangle corners per control.
normalIndicesnikIntArrayFace-vertex normal IDs at the 3 triangle corners. Used for smooth normal reconstruction at runtime.
bindTangentsbtkDoubleArrayTwo edge-relative tangent coefficients per control [a, b] such that tangent = a·edge₀ + b·edge₁.
bindSurfaceMatricesbsmkMatrixArrayWorld-space surface matrix at bind time. Inverted and stored for offset computation in -maintainOffset mode.
bindControlMatricesbcmkMatrixArrayControl world matrix at bind time. Hidden. Used with bindSurfaceMatrices to reconstruct the bind offset.
bindMaintainOffsetbmokBooleanHidden flag, set true when bound with -maintainOffset. Persists bind mode across rebinds.
bindUseControlInversebuikBooleanHidden flag for -inverse bind mode. Persists across rebinds.

Outputs

Long NameShortTypeDescription
outputMatrix[]omkMatrix[]Per-control world-to-parent matrix. Connect to control.offsetParentMatrix.
outputTranslate[]otdouble3[]Per-control parent-space translation. Connect to control.translate for translate-only following.

Connection Diagram

head_GEOShape
worldMesh[0]
surfacePin1
outputMatrix[i]
ctrl_i.offsetParentMatrix
ctrl_i_parent
worldInverseMatrix[0]
surfacePin1
controlParentInverseMatrix[i]
(inverse mode)
ctrl_i.inverseMatrix
surfacePin1
controlLocalInverseMatrix[i]

surfacePinBind Command

Creates a surfacePin node (or appends to an existing one), bakes all bind data from the mesh at its current deformed state, and wires the full connection graph. Fully undoable.

Syntax

# Create a new node
surfacePinBind mesh ctrl0 ctrl1 ... [flags]

# Append controls to an existing node
surfacePinBind [mesh] ctrl0 ctrl1 ... -node surfacePin1 [flags]

# Rebind all controls using stored mesh (no arguments)
surfacePinBind -node surfacePin1

Returns the name of the surfacePin node.

Flags

ShortLongArgDescription
-n-nodestringName of an existing surfacePin node to append controls to, or to rebind. If omitted, a new node is created.
-mo-maintainOffsetPreserve each control's current world-space pose. Zeros local TRS, sets scale to 1.0, and stores the difference as a bind offset applied at runtime.
-iv-inverseboolConnect the control's own inverseMatrix back into the node. Cancels the control's local TRS visually so it can drive shapes without double-transforming.
-c-connectstringOutput mode: "matrix" (default) wires outputMatrix → offsetParentMatrix; "translate" wires outputTranslate → translate.
-to-translateOnlyboolAlias for -connect translate. Only translation follows the surface; orientation is not driven.

Examples

// Basic bind: snap controls to mesh surface
surfacePinBind head_GEO ctrl_0 ctrl_1 ctrl_2;

// Maintain current world positions
surfacePinBind head_GEO mouth_ctrl -maintainOffset;

// Cancel local double-transform (inverse mode)
surfacePinBind head_GEO lip_ctrl -inverse true;

// Translate-only following
surfacePinBind head_GEO brow_ctrl_L -connect translate;

// Append to existing node
surfacePinBind head_GEO new_ctrl_0 -node surfacePin1;

// Rebind all controls after repositioning
surfacePinBind -node surfacePin1;
import maya.cmds as cmds

# Basic bind
node = cmds.surfacePinBind('head_GEO', 'ctrl_0', 'ctrl_1')

# Maintain offset
node = cmds.surfacePinBind('head_GEO', 'mouth_ctrl', maintainOffset=True)

# maintainOffset + inverse — creates a new surfacePin node
node = cmds.surfacePinBind('head_GEO', 'lip_ctrl', maintainOffset=True, inverse=True)

# maintainOffset + inverse — appends to an existing node
node = cmds.surfacePinBind('head_GEO', 'brow_ctrl', node='surfacePin1', maintainOffset=True, inverse=True)

# Translate-only
node = cmds.surfacePinBind('head_GEO', 'cheek_ctrl', connect='translate')

# Rebind in-place
cmds.surfacePinBind(node=node)
Note — rebind vs. recreate When controls are repositioned (e.g. after a rig sculpt pass), call surfacePinBind -node <node> with no mesh/control arguments. The command reads the stored mesh connection and re-bakes all bind data. The node identity and all outgoing connections are preserved.

surfaceUVPin Node

surfaceUVPin is a UV-space variant of surfacePin. Rather than storing vertex indices at bind time, it stores the UV coordinates of each pin location. At runtime, those UVs are resolved back to triangle barycentric coordinates within the current UV triangle set.

This makes pins stable across topology changes that preserve UV layout — a common workflow when sculpting or re-topo'ing a mesh while retaining its UV map. The trade-off is a one-time UV-triangle rebuild cost whenever the UV set changes.

Key differences from surfacePin

FeaturesurfacePinsurfaceUVPin
Pin storageVertex indices + barycentric weightsUV coordinates per pin
Survives retopologyNo (vertex indices change)Yes (if UVs are preserved)
UV set supportNamed UV set via uvSet attribute
Bind commandsurfacePinBindsurfaceUVPinBind
Node schedulingkParallelkParallel
When to use surfaceUVPin Use surfaceUVPin when your mesh is still being finalized (retopo, sculpt changes) but the UV layout is locked. Use surfacePin for maximum runtime performance when topology is frozen.

Attributes

deformedGeometry, geometryWorldMatrix, controlParentInverseMatrix[], controlLocalInverseMatrix[], outputMatrix[], and outputTranslate[] work the same way. The UV-specific stored attributes are listed below.

UV Bind Data (Storable)

Long NameShortTypeDescription
pinUVspuvkDoubleArrayStored UV coordinate per pin, flat array of length N×2. Written at bind time; resolved to barycentric coords each frame via the UV triangle set.
preferredTriangleIndicesptikIntArrayPer-pin preferred triangle index used to disambiguate UV seams. Written at bind time. Set to -1 when no preference is recorded.
uvSetuvskStringNamed UV set used for pin resolution. Defaults to the mesh's default UV set. Changing this triggers a full UV triangle rebuild.
bindTangentsbtkDoubleArrayEdge-relative tangent coefficients [a, b] per pin. Same storage format as surfacePin.
bindSurfaceMatricesbsmkMatrixArrayWorld-space surface matrix at bind time. Used for offset computation in -maintainOffset mode.
bindControlMatricesbcmkMatrixArrayControl world matrix at bind time. Hidden.
bindMaintainOffsetbmokBooleanHidden flag — set true when bound with -maintainOffset.
bindUseControlInversebuikBooleanHidden flag — set true when bound with -inverse.

surfaceUVPinBind Command

Creates a surfaceUVPin node and binds controls. Flags are a subset of surfacePinBind:

ShortLongArgDescription
-n-nodestringExisting surfaceUVPin node to append controls to.
-mo-maintainOffsetPreserve current world pose; stores bind offset.
# Python
node = cmds.surfaceUVPinBind('head_GEO', 'ctrl_0', 'ctrl_1')
node = cmds.surfaceUVPinBind('head_GEO', 'mouth_ctrl', maintainOffset=True)

shapeControl Node

A VP2 MPxLocatorNode with a full MPxDrawOverride that renders in DX11/OpenGL/Metal. It accepts an optional geometry input (inGeometry) and draws the connected mesh or NURBS curve directly in the viewport using the locator's transform, with configurable draw style, line width, color, transparency, and X-ray mode.

Key display attributes

AttributeDescription
inGeometryMesh or curve shape to display. When connected, the locator draws the geometry in viewport.
color / hoverColor / selectedColorRGB display color per state.
transparency / hoverTransparency / selectedTransparencyAlpha per state.
drawInXrayIf true, renders the locator in the X-ray pass (draws through occluding geometry).
wireframeDraw as wireframe rather than filled.
enableHoverEnable per-frame hover testing.
lineStyle / lineWidthVP2 line style enum and width for wireframe drawing.
showTransformReadoutDisplay an in-viewport transform text readout with optional slider widget.
primitiveDraw primitive: Points, Lines, LineStrip, ClosedLine, Triangles, TriStrip.
paintStyleVP2 MUIDrawManager::PaintStyle (flat, stippled, etc.).
inverseWhen true, the locator cancels its own local transform, matching the self-compensating behaviour set up by -inverse in surfacePinBind.

shapeControlCreate Command

Select a mesh or curve first, then run. By default the command bakes the source geometry into the control at creation time — the result is lightweight because no live connection to the original source is needed during playback. Use live=True to keep the source connected so the control shape follows deformation.

# Baked — fastest, does not follow deformation
cmds.select('my_ctrl_shape_GEO')
cmds.shapeControlCreate()

# Live — follows source deformation, heavier
cmds.shapeControlCreate(live=True)
ModeBest forCost
Baked (default) Final animator-facing controls, selectable rig controls, static custom icons Very lightweight — no live geometry connection
Live Controls that must follow a deforming source during layout or setup Heavier — per-locator VP2 cost every frame. Avoid for 50+ controls; use meshControlMode instead

meshControlOverlay Node

A VP2 locator that draws a surface marker at a tracked hit position on a source mesh, with an optional wireframe overlay and in-viewport transform readout. It receives hit-point and hit-normal data (from meshControlMode) via the hitPosition and hitNormal attributes, and renders a configurable marker at that location in real time.

The overlay caches the source mesh geometry (triangulated positions and face normals) with a serial number invalidation strategy — geometry is only rebuilt when the source mesh changes shape or topology. The draw override uses a precomputed MMatrix cache for world-to-overlay transforms.

Key attributes

AttributeDescription
sourceMeshPathsString array of DAG paths to the source meshes to test against and overlay.
enableEnable or disable the overlay. When false the draw override skips all geometry and marker drawing.
inMeshOptional direct mesh input. When connected, used as the draw source instead of resolving via sourceMeshPaths.
trackedMeshPathsString array of DAG paths currently tracked by meshControlMode. Written by the command; read by the overlay to drive per-patch draw data.
hitPosition / hitNormalWorld-space hit result from the interactive mode. Updated by meshControlMode callbacks.
surfaceOffsetScaleScales the overlay offset along the surface normal (prevents z-fighting).
drawMarkerShow a circle/dot at the hit position.
drawWireframe / drawWireframeWidthDraw the source mesh wireframe on top of the surface.
drawInXrayRender the overlay in the X-ray pass.

meshControlMode Command

An interaction and overlay system for working with mesh-based controls. It tracks selected meshes, draws hover and selection overlays via meshControlOverlay, and supports binding a driver mesh to driven control meshes through vertexWrap. Internally, a Qt QObject event filter intercepts mouse-move events in the active viewport and performs a ray-cast against the tracked surface on each move, updating the overlay hit position in real time.

Using meshControlOverlay for batched drawing makes this significantly more efficient than many separate live shapeControl nodes — all draw data goes through one overlay node with no per-mesh VP2 draw call overhead.

# Bind driver + targets to a vertexWrap node and start tracking
cmds.select('driverA', 'a', 'b', r=True)
cmds.meshControlMode(bind='driverA_vertexWrap')

Selection Behavior

Clicking a hovered tracked patch selects its selection target. The target is resolved in order:

  1. If the patch has meshControlSelectNode connected → selects that connected transform
  2. Else if the attribute meshControlSelectParent on the tracked mesh is true → selects the parent transform
  3. Otherwise → selects the mesh transform itself (default)
In the default case with no extra connections, clicking a hovered patch simply selects the mesh transform it belongs to.

Flags

# Tracking
cmds.meshControlMode(enable=True)       # enable / refresh tracking from mesh selection
cmds.meshControlMode(enable=False)      # disable mode
cmds.meshControlMode(append=True)       # append selected meshes to tracked list
cmds.meshControlMode(remove=True)       # remove selected meshes from tracked list
cmds.meshControlMode(clear=True)        # clear tracked meshes

# Display
cmds.meshControlMode(xray=True)         # draw overlay in xray
cmds.meshControlMode(wireframe=True)    # draw wireframe overlay
cmds.meshControlMode(marker=True)       # draw hover marker

# Utility
cmds.meshControlMode(select=True)       # select the overlay node
cmds.meshControlMode(reactivate=True)   # reinstall / reactivate viewport mouse filter
Platform note The Qt mouse event filter is compiled conditionally. If Qt headers are not available at build time, the command registers but the interactive hover feature is disabled (CUSTOM_LOCATOR_HAS_QT_SUPPORT 0).

Performance Benchmarks

Evaluation time measured against Maya's built-in uvPin and proximityPin nodes. Tests use a deforming animated sphere mesh (80-subdivision, ~10K vertices) driven by a blendShape + animated transform group, with controls distributed in a Fibonacci sphere pattern. Parallel evaluation enabled, 120 frames × 2 repeats.

Evaluation time — ms/frame vs. control count
Why surfacePin / surfaceUVPin Beyond raw evaluation speed, both nodes offer workflow advantages over Maya's built-in alternatives. Maintain Offset is handled automatically at bind time — each control's current world pose is preserved with no manual offset group setup required. The Inverse input cancels the control's own local transform to eliminate double-transformation in a facial rig hierarchy, without needing extra compensate nodes or additional connections.

Technical Notes

Node IDs

NodeType ID
shapeControl0x00140542
meshControlOverlay0x00140543
vertexWrap0x00140544
surfacePin0x00140545
surfaceUVPin0x00140546
hoverMarker0x00140547

TBB Parallelism

Both surfacePin and surfaceUVPin use tbb::parallel_for over the N-control loop in compute(). The node scheduling type is kParallel, so Maya's parallel evaluation manager can also run multiple node evaluations concurrently across the DG.

Tangent Stability

Tangents are stored as two scalar coefficients [a, b] relative to the containing triangle's edge vectors, not as a world-space direction. At runtime: T = a·edge₀ + b·edge₁. This means the tangent deforms with the mesh geometry and never drifts due to world-space rotation or scale — a common artifact in UV-tangent or fixed-reference approaches.

Smooth Normal Reconstruction

Rather than using Maya's cached face-vertex normals (which can produce seams at hard edges), surfacePin computes local topology normals at runtime: for each triangle corner vertex, it averages the cross products of the surrounding edge pairs in a configurable vertex ring, then barycentric-blends those three corner normals. This produces C⁰-continuous normals across the surface and handles hard edges correctly.