Has 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]

source

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.

ParameterTypeDescription
body_lodLiteral[0, 1, 2]
default 0
See set_body_lod.
clothingstr
default 'original'
Option of the clothing LOD, "original", "high", "medium" or "low".
eyesstr
default 'original'
Detail of the game eyes, "original", "high", "medium" or "low".
teethLiteral[0, 1, 2]
default 0
See set_teeth_lod.
remove_clothing_subdivbool
default True
Whether subdivision modifiers are removed from the clothing.
remove_clothing_solidifybool
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)

source

Set the LOD of the body mesh.

ParameterTypeDescription
lodLiteral[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.
contextC
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)

source

Set the LOD of the clothing meshes by decimating them.

ParameterTypeDescription
qualityUnion[str, float]
default 'medium'
"original", "high", "medium" or "low" as in `QualitySettings.clothing`, or the decimate ratio itself.
remove_subdivbool
default True
Whether to remove subdivision modifiers.
remove_solidifybool
default True
Whether to remove solidify modifiers.
keep_shape_keysbool
default True
Decimate the shape keys of the clothing along with the mesh, instead of applying them first. Slower.
contextC
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)

source

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.

ParameterTypeDescription
lodLiteral[0, 1, 2]LOD to set the teeth to. 0 means no difference, 1 leaves about 4,600 triangles and 2 about 3,300.
contextC
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.