# zBoneWarp¶

Create a zBoneWarp deformer to warp bone mesh(es) using a harmonic deformation field defined by “source cage” and “target cage” meshes, and landmark field painted onto each bone mesh (to keep the bones as straight as possible).

For more details, see Bone Warp.

zBoneWarp [flags] [<source_cage> <target_cage> <bone mesh(es)_to_warp>]
-h   -help                   <n/a>     This message.
-t   -tetSize                <float>   Set the tet mesh size for the internally used harmonic warp, in scene units.
No tets will be larger than this value. Same usage as in the zHarmonicWarp node.
-m   -maxResolution          <int>     Interrupts the computation if the smallest tet would divide the object into more than
this many tets per side. For example, if maxResolution=100, then the tet meshing will
abort if the tets will be smaller than 1% of the width of the object. This does not
affect the result (assuming the computation was not interrupted). This usage is the same
as in the zTet and zHarmonicWarp nodes. It exists to guard against crashing the tet mesher
if tetSize is set to a tiny value.
-s   -surfacePenalty         <float>   Controls the tradeoff between the smoothness of the output, and how precisely the warp obeys the
target cage. This value is given on a log scale, and can be negative, zero or positive.
Smaller values increase the smoothness at the cost of the warp deviating more from the target cage.
Same usage as in the zHarmonicWarp node.
-b   -boneTetMeshResolution  <int>     A tet mesh is computed for each bone, to aid with the bone warping. This parameter controls the
resolution of this tet mesh: the size of the tets is the width of the bone divided by this value.
-i   -maxIterations          <int>     Maximum number of iterations for computing the per-bone deformer (see below).

The "source cage" and "target cage" meshes must have the same number of vertices and must be closed.
They define the volume in which the warp will be performed. This warp only operates on meshes (the "bone meshes").
The bone meshes to be warped must be inside the volume enclosed by the "source cage". The output meshes will lie
inside the volume enclosed by the "target cage". The vertices of the "source cage" and "target cage" meshes must
be in 1:1 correspondence and in the same order.

Much like the harmonic warp, the bone warp creates a harmonic warp inside the volume occupied by the "source cage".
This warp is constrained to map the "source cage" mesh onto the "target cage" mesh. Subject to this constraint,
the command creates a deformation field inside the volume enclosed by "source cage" that is spatially as smooth
as possible. Parameter zBoneWarp.surfacePenalty controls the hardness of the constraint. The larger the value, the harder the
constraint: the "source cage" mesh will warp closer to the "target cage", with a higher chance of the warp being unstable.
A tet mesh will be created internally to perform the harmonic warp. The tetSize parameter controls the
resolution in Maya units. The smaller the value, the more precise the warp, but also the higher the resolution
and the longer the computation time.

The warping of each bone is controlled using the above-mentioned harmonic warp, and a special per-bone
deformer that keeps the bones straight. The per-bone deformer is computed on a per-bone tet mesh; the
tet mesh resolution is controlled by the boneTetMeshResolution parameter. The user controls the per-bone deformer
by painting a landmark map onto the bone mesh. Specifically, our implementation places a landmark
at the center of each "blob" of the painted landmark map. A 'blob' is a connected region with non-zero map values.
For each blob, the landmark position is computed as the average position of vertices in the blob, weighted with
the painted vertex weights in the blob. Landmarks can be visualized by selecting the zBoneWarp node.
Each bone is warped by first warping its landmarks using the harmonic warp. Then, the bone geometry is warped
using a per-bone mesh deformation function defined by the landmarks. This ensures that the bones follow the landmarks,
but otherwise remain as straight as possible.

Usage:
Select/specify the following objects, in this order:
(1) The "source cage" mesh
(2) The "target cage" mesh
(3) The bone shape(s) to be deformed by the bone warp.

Running zBoneWarp with these objects selected will create a zBoneWarp deformer node that deforms the bone shape(s).