# FacialHairSettings

> Human Generator for Blender documentation. Web version: https://humgen3d.com/docs/api/facialhairsettings

Reached as: `human.hair.face_hair`

Inherits from: [ImportableHair](https://humgen3d.com/docs/api/importablehair)

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/face_hair.py#L13

Class for manipulating facial hair of human.

## Attributes

### lightness

```python
human.hair.face_hair.lightness: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L47

### redness

```python
human.hair.face_hair.redness: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L48

### roughness

```python
human.hair.face_hair.roughness: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L49

### salt_and_pepper

```python
human.hair.face_hair.salt_and_pepper: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L50

### roots

```python
human.hair.face_hair.roots: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L51

### root_lightness

```python
human.hair.face_hair.root_lightness: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L52

### root_redness

```python
human.hair.face_hair.root_redness: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L53

### roots_hue

```python
human.hair.face_hair.roots_hue: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L54

### fast_or_accurate

```python
human.hair.face_hair.fast_or_accurate: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L55

### hue

```python
human.hair.face_hair.hue: NodeInput
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L56

### particle_systems

```python
human.hair.face_hair.particle_systems: PropCollection
```

*read-only, inherited from BaseHair*

Get propcollection of particle systems on the human used by this hair type.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L59

### modifiers

```python
human.hair.face_hair.modifiers: PropCollection
```

*read-only, inherited from BaseHair*

Modifiers associated with the particle systems of this hair type.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L71

### haircard_obj

```python
human.hair.face_hair.haircard_obj: Optional[bpy.types.Object]
```

*read-only, inherited from BaseHair*

Blender object of haircards IF generated.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L86

### materials

```python
human.hair.face_hair.materials: list[bpy.types.Material]
```

*read-only, inherited from BaseHair*

List of materials used for this type of hair.

Usually singleton, but will contain multiple values if haircards are generated.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L97

### nodes

```python
human.hair.face_hair.nodes: PropCollection
```

*read-only, inherited from BaseHair*

PropCollection of nodes used in the materials for this type of hair. # noqa

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L111

## Methods

### as_dict()

```python
human.hair.face_hair.as_dict() -> dict[str, Any]
```

Returns dict of face hair settings.

Returns: dict[str, Any] — dict[str, dict[str, Any]]: Dict of face hair settings

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/face_hair.py#L32

### convert_to_haircards()

```python
human.hair.face_hair.convert_to_haircards(quality: Literal['ultra', 'high', 'medium', 'low', 'haircap_only'] = 'high', context: C = None, triangle_budget: Optional[int] = None) -> bpy.types.Object
```

*inherited from BaseHair*

Convert the hair of this type to haircards.

Will generate a mesh object consisting of a haircap and haircards, skinned to
the rig of the human. For eye systems only a haircap will be generated. The
object follows the expressions of the human.

Parameters:
- `quality` (Literal['ultra', 'high', 'medium', 'low', 'haircap_only'], default 'high'): Quality of the haircards, which sets the number of triangles of the generated object. Defaults to high.
- `context` (C, default None): Blender context. bpy.context if not provided.
- `triangle_budget` (Optional[int], default None): Maximum number of triangles of the generated object, overrides the budget of the quality.

Returns: bpy.types.Object — bpy.types.Object: Blender object of the haircap and haircards

Raises: HumGenException — If this human has no hair of this type to convert.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L122

### get_evaluated_particle_systems()

```python
human.hair.face_hair.get_evaluated_particle_systems(context: C = None) -> PropCollection
```

*inherited from BaseHair*

Get an evaluated version of the particle systems of this hair type.

Parameters:
- `context` (C, default None): Blender context. bpy.context if not provided.

Returns: [PropCollection](https://humgen3d.com/docs/api/propcollection) — PropCollection of evaluated particle systems

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L283

### delete_all()

```python
human.hair.face_hair.delete_all()
```

*inherited from BaseHair*

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L299

### randomize_color()

```python
human.hair.face_hair.randomize_color()
```

*inherited from BaseHair*

Randomize the color of the hair of this type.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L302

### set()

```python
human.hair.face_hair.set(preset: str, context: C = None)
```

*inherited from ImportableHair*

Loads hair system the user selected.

Parameters:
- `preset` (str): Name of the preset to load. Must be in the preview collection. Options can be retreived from `get_options()`.
- `context` (C, default None): Blender context. bpy.context if not provided.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L377

### save_to_library()

```python
human.hair.face_hair.save_to_library(particle_system_names: list[str], hairstyle_name: str, category: str, for_male: bool = True, for_female: bool = True, thumbnail: Optional[Image] = None, context: C = None)
```

*inherited from ImportableHair*

Save the currently active hair system of this type to the HG library.

Parameters:
- `particle_system_names` (list[str]): Names of the particle systems to save.
- `hairstyle_name` (str): Name to save this hairstyle as.
- `category` (str): Category to save this hairstyle in. If this category does not already exist, a new folder will be created.
- `for_male` (bool, default True): Whether this hairstyle is available for male humans.
- `for_female` (bool, default True): Whether this hairstyle is available for female humans.
- `thumbnail` (Optional[Image], default None): Thumbnail to save with this hairstyle. Pass a Blender Image object here. If None, no thumbnail will be used.
- `context` (C, default None): Blender context. bpy.context if not provided.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L473

### remove_all()

```python
human.hair.face_hair.remove_all()
```

*inherited from ImportableHair*

Remove all modifiers of this hair type from the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L511

### randomize()

```python
human.hair.face_hair.randomize(context: C = None)
```

*inherited from ImportableHair*

Pick a random hairstyle from the library and apply it to the human.

Parameters:
- `context` (C, default None): Blender context. bpy.context if not provided.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/hair/basehair.py#L517

### set_random()

```python
human.hair.face_hair.set_random(context: C = None, update_ui: bool = False)
```

*inherited from PreviewCollectionContent*

Set this content type to a random content item.

This will use random.choice to select a random item from the output of
get_options().

Parameters:
- `context` (C, default None): Blender context. bpy.context if not provided.
- `update_ui` (bool, default False): Will also show the chosen item as the active thumbnail in the template_icon_view. Defaults to False.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/common_baseclasses/pcoll_content.py#L68

### get_options()

```python
human.hair.face_hair.get_options(context: C = None, category: str = 'All') -> List[str]
```

*inherited from PreviewCollectionContent*

Get a list of options you can use for the set() method of this content.

These represent the choises the user sees in the UI. The output is a list of
relative paths to the content files, starting from the Human Generator folder.

Parameters:
- `context` (C, default None): Blender context. bpy.context if not provided.
- `category` (str, default 'All'): Category to filter the content by. Defaults to "All". You can get a list of categories from the get_categories() method.

Returns: List[str] — List[str]: List of relative paths to content files. You can pick one of these and pass it to the set() method.

Raises: ValueError — If the passed category is not present in the list of categories.

Raises: HumGenException — If no options can be found, this can be caused by the content pack for this type of content not being installed.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/common_baseclasses/pcoll_content.py#L98

### get_categories()

```python
human.hair.face_hair.get_categories() -> list[str]
```

*inherited from PreviewCollectionContent*

Get a list of categoris this content type is organized in.

You can choose one of these categories to filter the content retreived from
get_options().

Returns: list[str] — list[str]: List of categories. These are the names of the folders the content is saved in.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/common_baseclasses/pcoll_content.py#L148

### refresh_pcoll()

```python
human.hair.face_hair.refresh_pcoll(context: C = None, override_category: Optional[str] = None, ignore_searchterm: bool = False)
```

*inherited from PreviewCollectionContent*

Refresh the items of this preview collection.

This is low level functionality, you should not need to use this. It is used
to refresh the list of possible content for this human. If you use get_options()
this is automatically done for you.

Parameters:
- `context` (C, default None): Blender context. bpy.context if not provided.
- `override_category` (Optional[str], default None): Override the category to use, if not provided all items regardless of category will be shown.
- `ignore_searchterm` (bool, default False): If True, the searchterm set by the user will be ignored. Defaults to False.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/common_baseclasses/pcoll_content.py#L180

### save_objects_optimized()

```python
FacialHairSettings.save_objects_optimized(context: bpy.types.Context, objs: Iterable[bpy.types.Object], folder: str, filename: str, clear_sk: bool = True, clear_materials: bool = True, clear_vg: bool = True, clear_ps: bool = True, run_in_background: bool = True, clear_drivers: bool = True)
```

*static method, inherited from SavableContent*

Saves the passed objects as a new blend file.

opening the file in the background to make it as small as possible

Parameters:
- `context` (bpy.types.Context): Blender context.
- `objs` (Iterable[bpy.types.Object]): List of objects to save
- `folder` (str): Folder to save the file in
- `filename` (str): Name to save the file as
- `clear_sk` (bool, default True): Remove all shapekeys from objs. Defaults to True.
- `clear_materials` (bool, default True): Remove all materials from objs. Defaults to True.
- `clear_vg` (bool, default True): Remove all vertex groups from objs. Defaults to True.
- `clear_ps` (bool, default True): Remove all particle systems from objs. Defaults to True.
- `run_in_background` (bool, default True): Open the new subprocess in the background. Defaults to True.
- `clear_drivers` (bool, default True): Remove all drivers from objs. Defaults to True.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/common_baseclasses/savable_content.py#L24

### remove_number_suffix()

```python
FacialHairSettings.remove_number_suffix(name: str) -> str
```

*static method, inherited from SavableContent*

Remove the number suffix from the passed name (i.e. Box.004 becomes Box).

Parameters:
- `name` (str): name to remove suffix from

Returns: str — name without suffix

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/common_baseclasses/savable_content.py#L152
