Maya cpp dev

 
 
Shrink Wrapping with muscle collisions

Shrink Wrapping with muscle collisions

Collision with a torus and adjusting the stretch iteration count to mimic the stretching of the skin. Normal relaxation can be seen when the torus is on the edge of the cube and the dynamic secondary motion towards the end is the Verlet. The initial…

Collision with a torus and adjusting the stretch iteration count to mimic
the stretching of the skin. Normal relaxation can be seen when the torus is on the edge of the cube and the dynamic secondary motion towards the end is the Verlet. The initial collisions have no stretch iterations and are then dialed to about 18 iterations to get the webbing/stretch effect.

An example of other ways the plugin can be useful. Shrink wrapping for muscle definition (Also good for fascia layers) and collision objects such as bugs under the skin.

An example of other ways the plugin can be useful. Shrink wrapping for muscle definition (Also good for fascia layers) and collision objects such as bugs under the skin.

Skin

Skin is a Maya cpp plugin that I started developing back in the mid 2000s and have been expanding and improving up until around 2014. It is a threaded c++ plugin that is designed to procedurally mimic skin behaviour such as muscle sliding, wrinkling, compression/stretch elastics as well as a few other things. Although I still fall back to this plugin a lot for the mesh fairing functionality in creature work I tend to favour the simulation of skin and muscle these days for so many reasons.

The collisions and mesh relaxation segments of the code are threaded with OpenMP. The stretching algorithm uses Pyramid coordinates to distribute the energy of the mesh iteratively with a projection of the points back onto collision surfaces after each iteration.

There are also options to relax the mesh based off edge length and face area changes in both compression and expansion states and each can be multiplied in separately via envelopes and painted vertex weights.

Verlet integration has been used for secondary ‘jiggle‘ like effects and and procedural wrinkling is based of the compression of the edge lengths and face areas. This can be dialed in via a multiplying envelope along with a similar method for shrink wrapping seen below.

For the projection of the points onto the collision surfaces the normals of the points in the current iteration are used as the ray in the collision test. These normal can also be relaxed iteratively to allow for ‘pinching‘ normals to be smoothed out before casting the ray. For extra control there are direction nodes that can be connected into the skin node which allows painting per point values for both per point direction and per point per collision object direction giving pretty good control over the direction in which a point is tested on a surface.

 

Harmonic Stretch

Harmonic Stretch is an MPxDeformer that uses the eigen package to solve the Conjugate Gradient for weight distribution based of edge neighbouring information. Basically Harmonic coordinates defined by edge connection. Boundary weights can be set between 0-1 for vertices that describe the motion or anchor points.

Coupled with an MPxLocator node that uses an MFnSingleIndexComponentList of type kMeshVertex and some matrix math to define the transformation of each point, the weights solved by the CG multiply the transformation.

Great for procedural muscle modelling and rigging. It is also really useful for membranes on Bat and Bird wings etc. Eigen threading is enabled so super quick in evaluating the weight distribution.

 
Example of the color deformation node in action.  Black is uncompressed faces, green is expansion and red compression.

Example of the color deformation node in action. Black is uncompressed faces, green is expansion and red compression.

Color Deformation

A simple MPxDeformer that adds color into a mesh based off the compressed or expanded state of each vertices faces.
The RGB values are:
R=Compressed state value
G=Expanded state value
B=Compressed state value/rest value

Great for driving animated displacement.
The color is stored in the mesh vertices as a color set and can be passed out through alembic caches or anything that supports animated vertex colors.