# BaseHair

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

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

Base class used for all four hair subclasses.

Contains ways to change the material of the hair, to access modifiers and particle
systems and to generate haircards.

## Attributes

### lightness

```python
BaseHair.lightness: NodeInput
```

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

### redness

```python
BaseHair.redness: NodeInput
```

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

### roughness

```python
BaseHair.roughness: NodeInput
```

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

### salt_and_pepper

```python
BaseHair.salt_and_pepper: NodeInput
```

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

### roots

```python
BaseHair.roots: NodeInput
```

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

### root_lightness

```python
BaseHair.root_lightness: NodeInput
```

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

### root_redness

```python
BaseHair.root_redness: NodeInput
```

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

### roots_hue

```python
BaseHair.roots_hue: NodeInput
```

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

### fast_or_accurate

```python
BaseHair.fast_or_accurate: NodeInput
```

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

### hue

```python
BaseHair.hue: NodeInput
```

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

### particle_systems

```python
BaseHair.particle_systems: PropCollection
```

*read-only*

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
BaseHair.modifiers: PropCollection
```

*read-only*

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
BaseHair.haircard_obj: Optional[bpy.types.Object]
```

*read-only*

Blender object of haircards IF generated.

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

### materials

```python
BaseHair.materials: list[bpy.types.Material]
```

*read-only*

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
BaseHair.nodes: PropCollection
```

*read-only*

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

### convert_to_haircards()

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

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
BaseHair.get_evaluated_particle_systems(context: C = None) -> PropCollection
```

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
BaseHair.delete_all()
```

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

### randomize_color()

```python
BaseHair.randomize_color()
```

Randomize the color of the hair of this type.

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

### as_dict()

```python
BaseHair.as_dict() -> dict[str, Any]
```

Return a dictionary representation of this hair type.

Contains information about material.

Returns: dict[str, Any] — dict[str, Any]: Dictionary representation of this hair type

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