Ground Strands Modifier 

Many Ornatrix operators need a distribution mesh to function properly. Such operators will query the distribution mesh from the operators before them. For instance, when you have a set of curves defining the hair guides without any surface beneath them you can use the Ground Strands operator to assign a distribution surface to them. This distribution surface can then be used by Hair from Guides operator to generate dense hair from the guides. Ground Strands operator projects the guides onto a mesh to figure out the closest point on the surface to each guide root. This projected surface point is used to determine texture coordinates and to update the guide position in the future when the mesh surface changes and deforms due to animation. This step is crucial because many Ornatrix operators require a distribution mesh to work properly, so this operator should be used to assign and ground the roots to a distribution mesh if it is not present.

 

Videos 

 

Mechanism 


'Floating' strands are re-projected onto the surface and assigned new surface info

Grounding in Ornatrix is the process of attaching surface dependance information to a strand (hair or guides) object. To do this strands are 'projected' onto base mesh. Once every strand root's position relative to the mesh is determined it is cached and attached to the strands as surface info that flows up in the pipeline. Surface info is often required to compute UV coordinates, to deform guides with mesh, and to inherit other surface-related properties for modifiers such as surface comb.

To make the best use of strand ground plugin you need to understand a couple of things that it does:
  1. Ornatrix always assumes that its hair are located in the same object space as the distribution mesh (ie. all operations with mesh vertices and hair strands are done in same space). Therefore, ground strand modifier will align the hair node you chose to ground with the selected distribution node. You can see this if you disable ground modifier and your previous guides aren't aligned as they're used to. This step is very necessary for further operations on guides.
  2. Ground strands will use closest triangles for each guide to find a suitable place to put it. If a guide's tip is closer to a triangle than its root, it will be flipped (ie. its root considered its tip). This ensures that guides retain their relative shape, however, in some rare cases it can cause some guides to stick to undesired surface points.
 

Grounding strands 

To assign a distribution surface to guides or hair in Ornatrix:

  1. Add a Ground Strands operator from Ornatrix Menu.
  2. In the Object Manager, click and drag a geometry object to the Distribution Mesh box
  3. Click the Attach Roots button in the operator settings.

The strands should now be projected onto the surface and follow it as it deforms.

 

Ungrounding strands 

To stop the operator from attaching strands to the distribution surface surface press the Detach Roots button.

 

Position blend ramp 

This curve ramp allows you to specify the effect, along the strands length, that the grounding will have on the resulting strands. Value of 1 indicates that the points of target strands should be moved into position of being attached to the surface. Value of 0 indicates that points should remain unaffected by this operator.

As a result you can, for example, leave the tips of the strands unaffected by this operator while having the roots be moved in such a way that they are attached to the mesh surface.

 

Parameters 

  • Distribution Mesh
    The polygonal mesh to use for grounding.
  • Dynamic Grounding
    If enabled, when input strand count changes the new strands will be automatically grounded without user needing to re-ground the rest.
  • Ground Closes End
    When on, the end of the strand which is closest to the distribution mesh will be considered the root.
  • Set Positions
    When on, applying the grounding will update the locations of each strand's root according to mesh deformation.
  • Set Rotations
    When on, applying the grounding will update the rotations of each strand's root according to mesh deformation.
  • Set Texture Coordinates
    When on, texture coordinates for the first channel will be generated and assigned to the target hair from its newly grounded surface.
 

Troubleshooting 

 

Grounded strands are rotated incorrectly 

  • Problem: After using the Ground Strands option the resulting guides or hair are rotated and/or placed incorrectly in the scene, not matching the input strands.
  • Cause: If you moved, rotated, or scaled pivots of either the strands object or distribution mesh you can get unpredictable results.
  • Solution: Use Reset XForm utility on both the strands and distribution mesh object to make sure transforms for both objects are normalized.
 

C++ SDK Access 

Ground Strands modifier is accessible via Ornatrix C++ SDK. You need to get an instance of GroundStrandsModifierFPInterface which exposes numerous methods:

#include "Public\GroundStrandsModifierFPInterface.h" 

// Get "Ground Strands" interface:
auto groundStrandsInstance = GroundStrandsModifierFPInterface::GetInterface( myModifier );
 

MaxScript Access 

You can access Ground Strands modifier via its MaxScript interface. For example:

-- Get MaxScript interface
groundStrandsInstance = $MyHairObject.modifiers[#Ox_Ground_Strands]

You can call the following functions on this interface to manipulate Ground Strands programmatically:

-- Ground strands at current frame. Same as clicking the 'Ground' GUI button.
groundStrandsInstance.Ground()

-- Sets the specified node as the surface node to which to attach strands
groundStrandsInstance.surface = $sceneNode
 

Examples 

You can find examples on usage of the edit guides modifier by examining the unit tests in Test_GroundStrandsModifier.ms.

 

Related Topics 

Missing Something? Let us know if this page needs more information about the topic.