3ds Max C++ API Reference
IHairModifier Class Referenceabstract

Provides access to hair strand definitions for a modifier that generates hair. More...

#include <IHairModifier.h>

Classes

struct  ShadingParameters
 Defines the standard set of shading parameters for hair strands. More...
 

Public Member Functions

virtual bool IsHairEnabled ()=0
 Returns whether this hair modifier is enabled. More...
 
virtual ShadingParameters GetShadingParameters (const TimeValue t, Interval &inout_validity)=0
 Returns the shading parameters defined by this hair modifier. More...
 
virtual bool GetHairDefinition (const TimeValue t, INode &node, MaxSDK::Array< unsigned int > &per_hair_vertex_count, MaxSDK::Array< Point3 > &vertices, MaxSDK::Array< float > &per_vertex_radius, MaxSDK::Array< Color > &per_vertex_color, MaxSDK::Array< Point3 > &per_vertex_normal, MaxSDK::Array< Point3 > &per_vertex_velocity, MaxSDK::Array< float > &per_vertex_opacity, MaxSDK::Array< Point2 > &per_vertex_uv)=0
 Fetches the hair modifier's definition of hair strands. More...
 

Detailed Description

Provides access to hair strand definitions for a modifier that generates hair.

The standard model for generating hair in 3ds Max is by applying a Hair Modifier to an existing geometry object. Renderer plugins that need the hair strand definition directly may use this interface to gather those definitions.

To retrieve a pointer to this interface, use EnumGeomPipeline() on a given node and perform a dynamic_cast<IHairModifier> on the pointer returned by IDerivedObject::GetModifier().

Member Function Documentation

◆ IsHairEnabled()

virtual bool IsHairEnabled ( )
pure virtual

Returns whether this hair modifier is enabled.

If this returns false, then this interface should be ignore altogether. This may happen, for example, if the hair modifier is set to generate geometry rather than hair primitives, in which case the Mesh evaluated for the node will contain the hair strands.

◆ GetShadingParameters()

virtual ShadingParameters GetShadingParameters ( const TimeValue  t,
Interval inout_validity 
)
pure virtual

Returns the shading parameters defined by this hair modifier.

These are the shading parameters that should be used when rendering the hair. The material assigned to the INode should be ignored in this case.

Parameters
tThe time at which to fetch the shading parameters, which may be animated.
[in,out]inout_validityThe validity of the returned value is intersected into the input value of this parameter.

◆ GetHairDefinition()

virtual bool GetHairDefinition ( const TimeValue  t,
INode node,
MaxSDK::Array< unsigned int > &  per_hair_vertex_count,
MaxSDK::Array< Point3 > &  vertices,
MaxSDK::Array< float > &  per_vertex_radius,
MaxSDK::Array< Color > &  per_vertex_color,
MaxSDK::Array< Point3 > &  per_vertex_normal,
MaxSDK::Array< Point3 > &  per_vertex_velocity,
MaxSDK::Array< float > &  per_vertex_opacity,
MaxSDK::Array< Point2 > &  per_vertex_uv 
)
pure virtual

Fetches the hair modifier's definition of hair strands.

The hair strands are defined as flat surfaces, facing the given normals. Each hair strand may have any number of vertices, the hair segments being linearly defined between the vertices.

Parameters
tThe time at which to fetch the hair strands definition.
[out]nodeThe hair strand node.
[out]per_hair_vertex_countThe number of vertices present in each hair strand, with one value for each hair strand.
[out]verticesThe position of each vertex. The number of vertices equals the sum of all values in per_hair_vertex_count.
[out]per_vertex_radiusThe radius of the hair strand, at each vertex.
[out]per_vertex_colorThe color of the hair strand, at each vertex.
[out]per_vertex_normalThe facing direction of the hair strand, at each vertex.
[out]per_vertex_velocityThe velocity of each vertex - that is, the vector defining the direction and amplitude of movement for one full frame of animation.
[out]per_vertex_opacityThe opacity of each vertex.
[out]per_vertex_uvThe UV coordinate at each vertex.
Returns
True on success, false on failure - for example, on failing to allocate memory.