LodSettings
human/process/lod.pyHas methods for setting LODs for the meshes of a human.
| Methods | ||
|---|---|---|
| estimate_triangles() | dict[str, int] | Estimate the triangle count of the meshes after setting these LODs. |
| set_body_lod() | Set the LOD of the body mesh. | |
| set_clothing_lod() | Set the LOD of the clothing meshes by decimating them. | |
| set_teeth_lod() | Set the LOD of the teeth meshes by decimating them. | |
Methods
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]
sourceEstimate 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.
| Parameter | Type | Description |
|---|---|---|
| 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".
human.process.lod.set_body_lod(lod: Literal[0, 1, 2], context: C = None)
sourceSet the LOD of the body mesh.
| Parameter | Type | Description |
|---|---|---|
| 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.
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)
sourceSet the LOD of the clothing meshes by decimating them.
| Parameter | Type | Description |
|---|---|---|
| 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.
human.process.lod.set_teeth_lod(lod: Literal[0, 1, 2], context: C = None)
sourceSet 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.
| Parameter | Type | Description |
|---|---|---|
| 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.