c4d.modules.hair.HairLibrary

class c4d.modules.hair.HairLibrary

Hair library class.

Methods Signatures

HairLibrary.SetMode(self, doc, mode)

Set hair mode.

HairLibrary.GetMode(self, doc)

Get hair mode.

HairLibrary.BlendColors(self, mode, colA, colB)

Blend colors.

HairLibrary.MixST(self, s, t, pa, pb, pc, ...)

Mix by the s and t coordinates among pa, pb, pc and pd.

HairLibrary.GetPolyPointST(self, p, pa, pb, pc, ...)

Calculate the s and t coordinates of the point p in the polygon described by pa, pb, pc and pd.

HairLibrary.GetHairVersion(self)

Get the hair version.

Methods Documentation

HairLibrary.SetMode(self, doc, mode)

Set hair mode.

Parameters
  • doc (c4d.documents.BaseDocument) – Document.

  • mode (int) –

    New hair mode:

    HAIR_MODE_LOCKED

    Locked mode

    HAIR_MODE_HIDDEN

    Hidden mode.

    HAIR_MODE_TIPS

    Tips mode.

    HAIR_MODE_POINTS

    Points mode.

    HAIR_MODE_GUIDES

    Guides mode.

    HAIR_MODE_ROOTS

    Roots mode.

    HAIR_MODE_VERTEX

    Vertex mode.

HairLibrary.GetMode(self, doc)

Get hair mode.

Parameters

doc (c4d.documents.BaseDocument) – Document.

Return type

int

Returns

Hair mode:

HAIR_MODE_LOCKED

Locked mode

HAIR_MODE_HIDDEN

Hidden mode.

HAIR_MODE_TIPS

Tips mode.

HAIR_MODE_POINTS

Points mode.

HAIR_MODE_GUIDES

Guides mode.

HAIR_MODE_ROOTS

Roots mode.

HAIR_MODE_VERTEX

Vertex mode.

HairLibrary.BlendColors(self, mode, colA, colB)

Blend colors.

Parameters
  • mode (int) – Blend mode. (See mhairmaterial.h for modes, e.g. HAIRMATERIAL_BLENDMODE_AVERAGE.)

  • colA (c4d.Vector) – First color.

  • colB (c4d.Vector) – Second color.

Return type

c4d.Vector

Returns

Resulting color.

HairLibrary.MixST(self, s, t, pa, pb, pc, pd, bQuad)

Mix by the s and t coordinates among pa, pb, pc and pd.

Parameters
  • s (float) – S coordinate.

  • t (float) – T coordinate.

  • pa (c4d.Vector) – First point value.

  • pb (c4d.Vector) – Second point value.

  • pc (c4d.Vector) – Third point value.

  • pd (c4d.Vector) – Fourth point value.

  • bQuad (bool) – True means quadrangle, False means triangle.

Return type

tuple(float, float)

Returns

The s and t coordinates.

HairLibrary.GetPolyPointST(self, p, pa, pb, pc, pd, bQuad)

Calculate the s and t coordinates of the point p in the polygon described by pa, pb, pc and pd.

Parameters
  • p (c4d.Vector) – Point to get the coordinates for.

  • pa (c4d.Vector) – First point value.

  • pb (c4d.Vector) – Second point value.

  • pc (c4d.Vector) – Third point value.

  • pd (c4d.Vector) – Fourth point value.

  • bQuad (bool) – True means quadrangle, False means triangle.

Return type

tuple(float, float)

Returns

The s and t coordinates.

HairLibrary.GetHairVersion(self)

Get the hair version.

Return type

int

Returns

Hair version number.