HairMaterialData Class Reference

#include <lib_hair.h>

Detailed Description

Contains information about hair materials. Cannot be allocated.

Public Member Functions

Int32 GetCount ()
 
Int32 GetGuideMaterial (Int32 i, Int32 prev=NOTOK)
 
BaseTagGetMaterialTag (Int32 i)
 
Bool ApplyMaterial (Int32 i, HairGuides *guides, VolumeData *vd=nullptr, Int32 vindex=0)
 
Bool ApplyMaterials (HairGuides *guides, VolumeData *vd=nullptr, Int32 vindex=0)
 
Float GetThickness (Int32 guide, Float t, Int32 i=NOTOK)
 
Vector GetColor (Int32 guide, Float t, const Vector &r, const Vector &wp, const Vector &p, const Vector &n, VolumeData *vd, const RayHitID &plyid, Int32 i=NOTOK)
 
Vector GetBackColor (Int32 guide, Float t, const Vector &col, const Vector &r, const Vector &wp, const Vector &p, const Vector &n, VolumeData *vd, const RayHitID &plyid, Int32 i=NOTOK)
 
Bool GetSpecularColor (Int32 guide, Float t, const Vector &wp, const Vector &p, const Vector &n, VolumeData *vd, const RayHitID &plyid, Vector &speccol, Vector &ispeccol)
 
Float GetTransparency (Int32 guide, Float t, const Vector &p, const Vector &n, VolumeData *vd, Int32 i=NOTOK)
 
Bool GetTagSelection (Int32 i, BaseSelect *bs)
 
Bool GetMaterialData (Int32 guide, Float &shadows, Float &selfshadows, Float &backshadows, Float &transparency, Float &diffuse, Float &reflect, Float &transmit, Bool &roughenable, Float &roughvar, Float &roughness, Bool &specularenable, Float &specular, Float &specularpower, Float &specularback, Bool &ispecularenable, Bool &ispecularshader, Float &ispecular, Float &ispecularpower, Float &ispecularmix, Float &ispecularblend)
 
Bool GetGIData (Int32 guide, Bool &receive, Float &strength)
 
Bool AdjustHUV (Int32 guide, Vector &huv, Float tline)
 

Private Member Functions

 HairMaterialData ()
 
 ~HairMaterialData ()
 

Constructor & Destructor Documentation

◆ HairMaterialData()

HairMaterialData ( )
private

◆ ~HairMaterialData()

~HairMaterialData ( )
private

Member Function Documentation

◆ GetCount()

Int32 GetCount ( )

Gets the number of hair material tags.

Returns
The hair material count.

◆ GetGuideMaterial()

Int32 GetGuideMaterial ( Int32  i,
Int32  prev = NOTOK 
)

Gets the material index for the specified hair index i, optionally looking for more materials by specifying prev.

Parameters
[in]iThe hair index.
[in]prevThe index of the previous material of the hair.
Returns
The material index, or NOTOK if there are no more materials for the hair.

◆ GetMaterialTag()

BaseTag* GetMaterialTag ( Int32  i)

Gets the material tag corresponding to the specified hair index i.

Parameters
[in]iThe hair index.
Returns
The material tag.

◆ ApplyMaterial()

Bool ApplyMaterial ( Int32  i,
HairGuides guides,
VolumeData vd = nullptr,
Int32  vindex = 0 
)

Applies a single material to the specified hair index i.

Parameters
[in]iThe hair index.
[in]guidesThe hair guide data.
[in]vdThe optional volume data.
[in]vindexThe material index.
Returns
true if successful, otherwise false.

◆ ApplyMaterials()

Bool ApplyMaterials ( HairGuides guides,
VolumeData vd = nullptr,
Int32  vindex = 0 
)

Applies a material to all hairs.

Parameters
[in]guidesThe hair guide data.
[in]vdThe optional volume data.
[in]vindexThe material index.
Returns
true if successful, otherwise false.

◆ GetThickness()

Float GetThickness ( Int32  guide,
Float  t,
Int32  i = NOTOK 
)

Gets the thickness at position t along the specified guide.

Parameters
[in]guideThe guide/hair index.
[in]tThe position along guide/hair: 0 <= t <= 1
[in]iPass NOTOK to use all materials, or a specific material index.
Returns
The thickness.

◆ GetColor()

Vector GetColor ( Int32  guide,
Float  t,
const Vector r,
const Vector wp,
const Vector p,
const Vector n,
VolumeData vd,
const RayHitID plyid,
Int32  i = NOTOK 
)

Gets the color at position t along the specified guide.

Parameters
[in]guideThe guide/hair index.
[in]tThe position along guide/hair: 0 <= t <= 1
[in]rThe root world coordinate.
[in]wpThe world coordinate of the sampling point.
[in]pThe UV coordinate.
[in]nThe surface normal at the root.
[in]vdThe volume data. Can be nullptr.
[in]plyidThe global RayHitID for the root.
[in]iPass NOTOK to use all materials, or a specific material index.
Returns
The color.

◆ GetBackColor()

Vector GetBackColor ( Int32  guide,
Float  t,
const Vector col,
const Vector r,
const Vector wp,
const Vector p,
const Vector n,
VolumeData vd,
const RayHitID plyid,
Int32  i = NOTOK 
)

Gets the back color at position t along the specified guide.

Parameters
[in]guideThe guide/hair index.
[in]tThe position along guide/hair: 0 <= t <= 1
[in]colThe color.
[in]rThe root world coordinate.
[in]wpThe world coordinate of the sampling point.
[in]pThe UV coordinate.
[in]nThe surface normal at the root.
[in]vdThe volume data. Can be nullptr.
[in]plyidThe global RayHitID for the root.
[in]iPass NOTOK to use all materials, or a specific material index.
Returns
The back color.

◆ GetSpecularColor()

Bool GetSpecularColor ( Int32  guide,
Float  t,
const Vector wp,
const Vector p,
const Vector n,
VolumeData vd,
const RayHitID plyid,
Vector speccol,
Vector ispeccol 
)

Gets the specular color at position t along the specified guide.

Parameters
[in]guideThe guide/hair index.
[in]tThe position along guide/hair: 0 <= t <= 1
[in]wpThe world coordinate of the sampling point.
[in]pThe UV coordinate.
[in]nThe surface normal at the root.
[in]vdThe volume data. Can be nullptr.
[in]plyidThe global RayHitID for the root.
[out]speccolAssigned the primary specular color.
[out]ispeccolAssigned the secondary specular color.
Returns
true if successful, otherwise false.

◆ GetTransparency()

Float GetTransparency ( Int32  guide,
Float  t,
const Vector p,
const Vector n,
VolumeData vd,
Int32  i = NOTOK 
)

Gets the transparency at position t along the specified guide.

Parameters
[in]guideThe guide/hair index.
[in]tThe position along guide/hair: 0 <= t <= 1
[in]pThe UV coordinate.
[in]nThe surface normal at the root.
[in]vdThe volume data. Can be nullptr.
[in]iPass NOTOK to use all materials, or a specific material index.
Returns
The transparency.

◆ GetTagSelection()

Bool GetTagSelection ( Int32  i,
BaseSelect bs 
)

Finds out which guides the specified material index i is applied to.

Parameters
[in]iThe material index.
[out]bsFilled with the guide indices the material is applied to.
Returns
true if successful, otherwise false.

◆ GetMaterialData()

Bool GetMaterialData ( Int32  guide,
Float shadows,
Float selfshadows,
Float backshadows,
Float transparency,
Float diffuse,
Float reflect,
Float transmit,
Bool roughenable,
Float roughvar,
Float roughness,
Bool specularenable,
Float specular,
Float specularpower,
Float specularback,
Bool ispecularenable,
Bool ispecularshader,
Float ispecular,
Float ispecularpower,
Float ispecularmix,
Float ispecularblend 
)

Gets the settings of the hair material.

Parameters
[in]guideThe guide/hair index.
[out]shadowsAssigned the shadows strength.
[out]selfshadowsAssigned the self shadows strength.
[out]backshadowsAssigned the back shadows strength.
[out]transparencyAssigned the transparency strength.
[out]diffuseAssigned the diffuse value.
[out]reflectAssigned the reflectiveness strength.
[out]transmitAssigned the translucence strength.
[out]roughenableAssigned roughness on/off state.
[out]roughvarAssigned the roughness variation strength.
[out]roughnessAssigned the roughness strength.
[out]specularenableAssigned the primary specular on/off state.
[out]specularAssigned the primary specular strength.
[out]specularpowerAssigned the primary specular sharpness strength.
[out]specularbackAssigned the back specular strength.
[out]ispecularenableAssigned the secondary specular on/off state.
[out]ispecularshaderAssigned the secondary specular shader on/off state.
[out]ispecularAssigned the secondary specular strength.
[out]ispecularpowerAssigned the secondary specular sharpness strength.
[out]ispecularmixAssigned the secondary specular mix strength.
[out]ispecularblendAssigned the secondary specular blend strength.
Returns
true if successful, otherwise false.

◆ GetGIData()

Bool GetGIData ( Int32  guide,
Bool receive,
Float strength 
)

Gets the Global Illumination (GI) settings of the hair material.

Parameters
[in]guideThe guide/hair index.
[out]receiveAssigned the receive GI on/off state.
[out]strengthAssigned the receive GI strength.
Returns
true if successful, otherwise false.

◆ AdjustHUV()

Bool AdjustHUV ( Int32  guide,
Vector huv,
Float  tline 
)

Gets the hair UVs for a specified Hair guide and position along the guide.

Parameters
[in]guideThe guide/hair index.
[out]huvAssigned the Hair UV coordinates.
[in]tlineThe position along the hair: 0 <= tline <= 1.
Returns
true if successful, otherwise false.