human.hair

HairSettings

human/hair/hair.py

Class for accessing hair types of human and common functionality.

Attributes
eyebrowsEyebrowSettingsProperty for accessing eyebrow settings.
eyelashesEyelashSettingsProperty for accessing eyelash settings.
face_hairFacialHairSettingsProperty for accessing facial hair settings.
regular_hairRegularHairSettingsProperty for accessing regular hair settings.
hair_typeslist[BaseHair]The hair types this human can have: regular hair, eyebrows, eyelashes and, for male humans, facial hair.
children_ishiddenboolCheck if hair children of systems are hidden.
particle_systemsbpy_prop_collectionAll particle systems of human body.
modifiersPropCollectionAll modifiers on human body.
Methods
estimate_haircards_triangles()intEstimate the triangle count of the haircards of all hair of this human.
set_connected()Shortcut for using `connect_hair` and `disconnect_hair` operators.
children_set_hide()Set the visibility state of the children of all hair systems.
remove_system_by_name()Remove a certain particle system from the human by its name.
update_hair_shader_type()Set the shader type between accurate (Eevee comp.) and fast (Cycles only).
set_hair_quality()Makes hairs thicker and lowers chileren amount for lower qualities.
as_dict() · set_from_dict()Save these settings to a dict and restore them from one.

Attributes

human.hair.eyebrows: EyebrowSettingsread-only

source

Property for accessing eyebrow settings.

human.hair.eyelashes: EyelashSettingsread-only

source

Property for accessing eyelash settings.

human.hair.face_hair: FacialHairSettingsread-only

source

Property for accessing facial hair settings.

Property for accessing regular hair settings.

human.hair.hair_types: list[BaseHair]read-only

source

The hair types this human can have: regular hair, eyebrows, eyelashes and, for male humans, facial hair.

human.hair.children_ishidden: boolread-only

source

Check if hair children of systems are hidden.

human.hair.particle_systems: bpy_prop_collectionread-only

source

All particle systems of human body.

human.hair.modifiers: PropCollectionread-only

source

All modifiers on human body.

Methods

human.hair.estimate_haircards_triangles(quality: str = 'high') → int

source

Estimate the triangle count of the haircards of all hair of this human.

The cards are assumed to use the full triangle budget of the quality, which they do unless the hair is very short.

ParameterTypeDescription
qualitystr
default 'high'
Quality of the haircards, "ultra", "high", "medium", "low" or "haircap_only".

Returns int — Triangles of the haircaps and haircards for all hair this human has.

human.hair.set_connected(connected: bool, context: C = None)

source

Shortcut for using connect_hair and disconnect_hair operators.

This should be used when modifying the body mesh (the actual mesh, not the shape keys).

ParameterTypeDescription
connectedboolTrue if hair should be connected, False otherwise.
contextC
default None
—

human.hair.children_set_hide(hide: bool)

source

Set the visibility state of the children of all hair systems.

If you will do a heavy computation on the human body, you should hide the children. This is already implemented for builtin heavy operations.

ParameterTypeDescription
hideboolTrue if children should be hidden, False otherwise.

human.hair.remove_system_by_name(name: str)

source

Remove a certain particle system from the human by its name.

ParameterTypeDescription
namestrName of the particle system to remove.

human.hair.update_hair_shader_type(shader_type: Literal['fast', 'accurate'])

source

Set the shader type between accurate (Eevee comp.) and fast (Cycles only).

ParameterTypeDescription
shader_typeLiteral['fast', 'accurate']Type to set the shader to.

human.hair.set_hair_quality(hair_quality: Literal['high', 'medium', 'low', 'ultralow'])

source

Makes hairs thicker and lowers chileren amount for lower qualities.

ParameterTypeDescription
hair_qualityLiteral['high', 'medium', 'low', 'ultralow']Quality to set all hair types on this human to.
Serialization: as_dict, set_from_dict

human.hair.as_dict() → dict[str, dict[str, Any]]

source

Return a dictionary representation of the hair settings.

Returns dict[str, dict[str, Any]] — dict[str, dict[str, Any]]: Dictionary representation of the hair settings.

human.hair.set_from_dict(data: dict[str, dict[str, Any]]) → list[str]

source

Set the hair settings from a dictionary representation.

See as_dict for structure.

ParameterTypeDescription
datadict[str, dict[str, Any]]Dictionary representation of the hair

Returns list[str] — list[str]: List of errors that occurred during setting.