HairSettings
human/hair/hair.pyClass for accessing hair types of human and common functionality.
| Attributes | ||
|---|---|---|
| eyebrows | EyebrowSettings | Property for accessing eyebrow settings. |
| eyelashes | EyelashSettings | Property for accessing eyelash settings. |
| face_hair | FacialHairSettings | Property for accessing facial hair settings. |
| regular_hair | RegularHairSettings | Property for accessing regular hair settings. |
| hair_types | list[BaseHair] | The hair types this human can have: regular hair, eyebrows, eyelashes and, for male humans, facial hair. |
| children_ishidden | bool | Check if hair children of systems are hidden. |
| particle_systems | bpy_prop_collection | All particle systems of human body. |
| modifiers | PropCollection | All modifiers on human body. |
| Methods | ||
| estimate_haircards_triangles() | int | Estimate 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
sourceProperty for accessing eyebrow settings.
human.hair.eyelashes: EyelashSettingsread-only
sourceProperty for accessing eyelash settings.
human.hair.face_hair: FacialHairSettingsread-only
sourceProperty for accessing facial hair settings.
human.hair.regular_hair: RegularHairSettingsread-only
sourceProperty for accessing regular hair settings.
human.hair.hair_types: list[BaseHair]read-only
sourceThe hair types this human can have: regular hair, eyebrows, eyelashes and, for male humans, facial hair.
human.hair.particle_systems: bpy_prop_collectionread-only
sourceAll particle systems of human body.
human.hair.modifiers: PropCollectionread-only
sourceAll modifiers on human body.
Methods
human.hair.estimate_haircards_triangles(quality: str = 'high') → int
sourceEstimate 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.
| Parameter | Type | Description |
|---|---|---|
| quality | str 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)
sourceShortcut for using connect_hair and disconnect_hair operators.
This should be used when modifying the body mesh (the actual mesh, not the shape keys).
| Parameter | Type | Description |
|---|---|---|
| connected | bool | True if hair should be connected, False otherwise. |
| context | C default None | — |
human.hair.children_set_hide(hide: bool)
sourceSet 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.
| Parameter | Type | Description |
|---|---|---|
| hide | bool | True if children should be hidden, False otherwise. |
human.hair.remove_system_by_name(name: str)
sourceRemove a certain particle system from the human by its name.
| Parameter | Type | Description |
|---|---|---|
| name | str | Name of the particle system to remove. |
human.hair.update_hair_shader_type(shader_type: Literal['fast', 'accurate'])
sourceSet the shader type between accurate (Eevee comp.) and fast (Cycles only).
| Parameter | Type | Description |
|---|---|---|
| shader_type | Literal['fast', 'accurate'] | Type to set the shader to. |
human.hair.set_hair_quality(hair_quality: Literal['high', 'medium', 'low', 'ultralow'])
sourceMakes hairs thicker and lowers chileren amount for lower qualities.
| Parameter | Type | Description |
|---|---|---|
| hair_quality | Literal['high', 'medium', 'low', 'ultralow'] | Quality to set all hair types on this human to. |
Serialization: as_dict, set_from_dict
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]
sourceSet the hair settings from a dictionary representation.
See as_dict for structure.
| Parameter | Type | Description |
|---|---|---|
| data | dict[str, dict[str, Any]] | Dictionary representation of the hair |
Returns list[str] — list[str]: List of errors that occurred during setting.