# LodSettings

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

Reached as: `human.process.lod`

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/lod.py#L39

Has methods for setting LODs for the meshes of a human.

## Methods

### estimate_triangles()

```python
human.process.lod.estimate_triangles(body_lod: Literal[0, 1, 2] = 0, clothing: str = 'original', eyes: str = 'original', teeth: Literal[0, 1, 2] = 0, remove_clothing_subdiv: bool = True, remove_clothing_solidify: bool = True) -> dict[str, int]
```

Estimate the triangle count of the meshes after setting these LODs.

Cheap enough to call while drawing the UI. The estimate ignores the parts of
the body that are hidden under clothing.

Parameters:
- `body_lod` (Literal[0, 1, 2], default 0): See set_body_lod.
- `clothing` (str, default 'original'): Option of the clothing LOD, "original", "high", "medium" or "low".
- `eyes` (str, default 'original'): Detail of the game eyes, "original", "high", "medium" or "low".
- `teeth` (Literal[0, 1, 2], default 0): See set_teeth_lod.
- `remove_clothing_subdiv` (bool, default True): Whether subdivision modifiers are removed from the clothing.
- `remove_clothing_solidify` (bool, default True): Whether solidify modifiers are removed from the clothing.

Returns: dict[str, int] — dict[str, int]: Triangle count for "body", "clothing", "eyes" and "teeth".

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/lod.py#L45

### set_body_lod()

```python
human.process.lod.set_body_lod(lod: Literal[0, 1, 2], context: C = None)
```

Set the LOD of the body mesh.

Parameters:
- `lod` (Literal[0, 1, 2]): LOD to set the body mesh to. 0 means no difference, 1 means lower polycount in the face and 2 means lower polycount in the whole body.
- `context` (C, default None): Blender context. bpy.context if not provided.

Raises: ValueError — If you pass a LOD value higher than the one the human currently has. At this moment it's not possible to revert LODs.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/lod.py#L101

### set_clothing_lod()

```python
human.process.lod.set_clothing_lod(quality: Union[str, float] = 'medium', remove_subdiv: bool = True, remove_solidify: bool = True, keep_shape_keys: bool = True, context: C = None)
```

Set the LOD of the clothing meshes by decimating them.

Parameters:
- `quality` (Union[str, float], default 'medium'): "original", "high", "medium" or "low" as in `QualitySettings.clothing`, or the decimate ratio itself.
- `remove_subdiv` (bool, default True): Whether to remove subdivision modifiers.
- `remove_solidify` (bool, default True): Whether to remove solidify modifiers.
- `keep_shape_keys` (bool, default True): Decimate the shape keys of the clothing along with the mesh, instead of applying them first. Slower.
- `context` (C, default None): Blender context. bpy.context if not provided.

Raises: ValueError — If the quality is not an option.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/lod.py#L153

### set_teeth_lod()

```python
human.process.lod.set_teeth_lod(lod: Literal[0, 1, 2], context: C = None)
```

Set the LOD of the teeth meshes by decimating them.

The gums, front teeth and molars are decimated separately, so every tooth
keeps its shape. The shape keys of the tongue are kept.

Parameters:
- `lod` (Literal[0, 1, 2]): LOD to set the teeth to. 0 means no difference, 1 leaves about 4,600 triangles and 2 about 3,300.
- `context` (C, default None): Blender context. bpy.context if not provided.

Raises: ValueError — If the teeth already have a lower level of detail, as they can only be decimated from their original resolution.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/process/lod.py#L207
