Particle Fur System
Since it uses particle instance, it's reasonably fast enough. It can be useful when you make feather or leaves because you can use any geometry as fur and control attachment so you can make leaf fall effects. Also it can be connected to dynamic field just like Maya particle. All attributes can be controlled by both attribute and textures (procedural or file) at the same time.
This mel command made all possible. Since Maya ver 7.0, particle can reference a special surface attribute such as Normal or Tangent. Particle emitted from surface can have parent UV attributes that represent the position on the surface where particle was born. Each particle can use this information to be stuck to the surface using goal weight. Just like parent UV, addPerParticleGoalPointAttr() add goalWorldNormal0PP to particles so particle can use this vector attribute to control the angle of instances which is the key function of this mel script.
During developing this mel script, I made a small utility
mel script that converts test expression code to mel code that generates
the expression code. I had to test pretty long particle expression and embed
it into the mel code, and changing object names to variable names was so
annoying. Using this multi text replacement mel, I could easily make a long
expression generation mel code.
If you add dynamic function on it, another particle is added and its goal target is set to original particle, so now the particle instance angle is controlled by the vector from original particle to additional particle instead of the surface normal. However, the surface normal is still used to set goal offset attribute for the additional particle.
And this is an example scene. Actually I made this fur system for this
short animation project, which I’m currently working on.