Ground Strands Modifier
Videos
Overview
'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:- 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.
- 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.
Parameters
Base Surface
The new distribution mesh to assign to hair. Each strand will be projected on to the surface of this object.
Ground Closest End
When turned on, each strand will be checked for which of its end is closest to the distribution object. That end will then be considered the root of the hair. If the option is off, the strand end with the smallest vertex index will be grounded as root.
Topology-Based
When turned on, this option will make the strands orient their twist based on the distribution object's topology. This is helpful to allow strands to rotate properly if the distribution object deforms over time.
Re-orient Hair Node
If this option is on, the hair node will be aligned with the distribution surface node before re-projecting. Sometimes this is required to get correct results.
Ground Strands Button
Click this button will perform the grounding operation.
Position blend curve
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.
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 programatically:
-- 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.