# Human

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

Reached as: `human`

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

Python representation of a Human Generator human.

This class with its subclasses can be used to modify the
Human Generator human inside Blender.

## Attributes

### body

```python
human.body: BodySettings
```

*read-only*

Points to the body settings of the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L281

### height

```python
human.height: HeightSettings
```

*read-only*

Points to the height settings of the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L290

### face

```python
human.face: FaceSettings
```

*read-only*

Points to the face settings of the human.

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

### age

```python
human.age: AgeSettings
```

*read-only*

Points to the age settings of the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L308

### pose

```python
human.pose: PoseSettings
```

*read-only*

Points to the pose settings of the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L317

### animation

```python
human.animation: AnimationSettings
```

*read-only*

Points to the animation settings of the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L326

### clothing

```python
human.clothing: ClothingSettings
```

*read-only*

Points to the clothing settings of the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L335

### expression

```python
human.expression: ExpressionSettings
```

*read-only*

Points to the expression settings of the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L344

### process

```python
human.process: ProcessSettings
```

*read-only*

Points to the class used by the process tab of HumGen.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L353

### materials

```python
human.materials: MaterialSettings
```

*read-only*

Points to the class giving access to different materials of human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L362

### objects

```python
human.objects: ObjectCollection
```

*read-only*

Get a collection of all objects that are part of the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L371

### children

```python
human.children: Iterable[Object]
```

*read-only*

A generator of all children of the rig object of the human.

Does NOT yield subchildren.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L381

### gender

```python
human.gender: GenderStr
```

*read-only*

Gender of this human in ("male", "female").

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L392

### pose_bones

```python
human.pose_bones: bpy_prop_collection
```

*read-only*

Pose bones of the human rig.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L401

### props

```python
human.props: HG_OBJECT_PROPS
```

*read-only*

Custom object properties of the human.

Used by the add-on for storing metadata like gender, backup_human pointer,
current phase, body_obj pointer. Points to rig_obj.HG

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L410

### skin

```python
human.skin: SkinSettings
```

*read-only*

Subclass used to change the skin material of the human body.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L423

### keys

```python
human.keys: KeySettings
```

*read-only*

Subclass used to access and change the shape keys of the body object.

Iterating yields key_blocks.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L432

### eyes

```python
human.eyes: EyeSettings
```

*read-only*

Subclass used to access and change the eye object and material.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L444

### hair

```python
human.hair: HairSettings
```

*read-only*

Subclass used to access and change the hair systems and materials.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L454

### export

```python
human.export: ExportBuilder
```

*read-only*

Subclass used to export the human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L464

### location

```python
human.location: FloatVectorProperty
```

Location of the human in Blender global space.

Retrieved from rig_obj.location

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

### rotation_euler

```python
human.rotation_euler: FloatVectorProperty
```

Euler rotation of the human in Blender global space.

Retrieved from rig_obj.rotation_euler

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L493

### name

```python
human.name: str
```

Name of this human. Takes name of rig object and removes HG_ prefix.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L513

### is_trial

```python
human.is_trial: bool
```

*read-only*

Whether this human is a trial human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L531

## Methods

### get_preset_options()

```python
Human.get_preset_options(gender: GenderStr, category: str = 'All', context: C = None) -> List[str]
```

*static method*

Return a list of human possible presets for the given gender.

Choose one of the options to pass to Human.from_preset() constructor.

Parameters:
- `gender` (GenderStr): string in ('male', 'female')
- `category` (str, default 'All'): Category to find presets for. Defaults to 'All'. You can get a list of all categories by calling Human.get_categories()
- `context` (C, default None): Blender context, uses bpy.context if not passed

Returns: List[str] — A list of starting human presets you can choose from

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L78

### from_existing()

```python
Human.from_existing(existing_human: Object, strict_check: bool = True) -> Human | None
```

*class method*

New instance from a passed Blender object that is part of an existing human.

Parameters:
- `existing_human` (Object): Object that is part of the human you want to get.
- `strict_check` (bool, default True): If True, the method will raise an exception if the passed object is not part of a human. If False, it will return None instead. Defaults to True

Returns: [Human](https://humgen3d.com/docs/api/human) | None — A Human instance or None

Raises: TypeError — Raised if the passed object is not a Blender object.

Raises: HumGenException — Raised if the passed object is not part of a human and strict_check is True. This will also raise if the passed object is part of a legacy human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L123

### from_preset()

```python
Human.from_preset(preset: str, context: C = None, prettify_eevee: bool = True, from_batch_generator: bool = False) -> Human
```

*class method*

Creates human in Blender based on passed preset and returns Human instance.

Parameters:
- `preset` (str): The name of the preset, as retrieved from Human.get_preset_options()
- `context` (C, default None): The Blender context. Defaults to bpy.context if None
- `prettify_eevee` (bool, default True): If True, the AO and Strip settings will be set to settings that look nicer. Defaults to True
- `from_batch_generator` (bool, default False): If True, some settings will be skipped as they are defined in the batch generator. Defaults to False

Returns: [Human](https://humgen3d.com/docs/api/human) — A Human instance

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L168

### get_categories()

```python
Human.get_categories(gender: GenderStr) -> list[str]
```

*static method*

Get a list of categories the human presets are divided into.

Parameters:
- `gender` (GenderStr): Gender to find categories for

Returns: list[str] — list[str]: List of categories, choose one to pass to get_preset_options()

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L259

### delete()

```python
human.delete()
```

Delete the human from Blender.

Will delete all meshes and objects that this human consists of, including
the backup human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L547

### hide_set()

```python
human.hide_set(state: bool)
```

Switch between visible and hidden state for all objects of this human.

Parameters:
- `state` (bool): Use True for hidden, False for visible

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L632

### make_camera_look_at_human()

```python
human.make_camera_look_at_human(obj_camera: Object, look_at_correction: float = 0.9)
```

Makes the passed camera point towards a preset point on the human.

Parameters:
- `obj_camera` (Object): Camera object
- `look_at_correction` (float, default 0.9): Correction based on how much lower to point the camera compared to the top of the armature

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L642

### save_to_library()

```python
human.save_to_library(name: str, category: str = 'Custom', thumbnail: Optional[Image] = None, context: C = None)
```

Save the human with it's current settings as a starting human preset.

Will add it to the content library.

Parameters:
- `name` (str): Name of the preset
- `category` (str, default 'Custom'): Category of the preset, defaults to "Custom". Creates new category if it doesn't exist yet.
- `thumbnail` (Optional[Image], default None): Image to use as thumbnail for the preset. If None no thumbnail will be added.
- `context` (C, default None): The context of the current scene.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L666

### as_dict()

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

Returns a dictionary representation of this human.

This is used for saving the human to a JSON file.

Returns: dict[str, Any] — A dictionary representation of this human.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L703

### duplicate()

```python
human.duplicate(context: C = None) -> Human
```

Make a copy of this human. Will both duplicate in Blender and Python.

All relations will be corrected:

Parameters:
- `context` (C, default None): The context of the current scene.

Returns: [Human](https://humgen3d.com/docs/api/human) — The duplicated human as Python instance.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L718

### render_thumbnail()

```python
human.render_thumbnail(folder: Optional[str] = None, name: str = 'temp_thumbnail', focus: str = 'full_body_front', context: C = None, resolution: int = 256, white_material: bool = False) -> str
```

Render a thumbnail of this human.

Parameters:
- `folder` (Optional[str], default None): Folder to save the thumbnail to. If None the default folder will be used.
- `name` (str, default 'temp_thumbnail'): Name of the thumbnail. Will be used as filename.
- `focus` (str, default 'full_body_front'): Focus of the thumbnail. Can be one of: "full_body_front", "full_body_side", "head_front", "head_side".
- `context` (C, default None): The context of the current scene.
- `resolution` (int, default 256): Resolution of the thumbnail. Defaults to 256.
- `white_material` (bool, default False): Use a white material for the human. Defaults to False.

Returns: str — Path to the rendered thumbnail.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/human.py#L774
