# KeySettings

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

Reached as: `human.keys`

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

Class for changing the shape keys and LiveKeys of this human.

## Attributes

### all_keys

```python
human.keys.all_keys: List[Union[LiveKeyItem, ShapeKeyItem]]
```

*read-only*

A list of all ShapeKeyItems and LiveKeyItems of this human.

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

### all_livekeys

```python
human.keys.all_livekeys: List[LiveKeyItem]
```

*read-only*

A list of all LiveKeyItems of this human.

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

### all_shapekeys

```python
human.keys.all_shapekeys: List[ShapeKeyItem]
```

*read-only*

A list of all ShapeKeyItems of this human.

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

### all_added_shapekeys

```python
human.keys.all_added_shapekeys: List[ShapeKeyItem]
```

*read-only*

A list of all ShapeKeyItems that were added by the user or converted from lk.

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

### all_deformation_shapekeys

```python
human.keys.all_deformation_shapekeys: List[ShapeKeyItem]
```

*read-only*

A list of ShapeKeyItems that are used for deformation.

This means they are not used for animation, but for changing the base shape of
the human. It leaves out the Basis key, the corrective keys, the eye look keys,
and the expression keys.

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

### temp_key

```python
human.keys.temp_key: bpy.types.ShapeKey
```

*read-only*

The temporary shape key used for livekeying. Points to the Blender key.

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

### permanent_key

```python
human.keys.permanent_key: bpy.types.ShapeKey
```

*read-only*

The permanent shape key used for livekeying. Points to the Blender key.

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

## Methods

### fold_temp_key()

```python
human.keys.fold_temp_key()
```

Moves the shape of the temporary live key into the permanent live key.

The livekey that was changed last lives in the temporary key, all the others
are summed in the permanent key. After this call all livekey values are in
the permanent key, so the shape of the body does not depend on the
temporary key anymore.

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

### get()

```python
human.keys.get(name: str) -> Optional[Union[ShapeKeyItem, LiveKeyItem]]
```

Parameters:
- `name` (str)

Returns: Optional[Union[[ShapeKeyItem](https://humgen3d.com/docs/api/shapekeyitem), [LiveKeyItem](https://humgen3d.com/docs/api/livekeyitem)]]

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

### filtered()

```python
human.keys.filtered(category: str, subcategory: Optional[str] = None) -> List[Union[LiveKeyItem, ShapeKeyItem]]
```

Get all keys that match the given category and subcategory.

Parameters:
- `category` (str): The category to filter for.
- `subcategory` (Optional[str], default None): The subcategory to filter for.

Returns: List[Union[[LiveKeyItem](https://humgen3d.com/docs/api/livekeyitem), [ShapeKeyItem](https://humgen3d.com/docs/api/shapekeyitem)]] — List[Union[LiveKeyItem, ShapeKeyItem]]: List of all keys matching the filter

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

### load_from_npz()

```python
human.keys.load_from_npz(npz_filepath: str, obj_override: Optional[Object] = None) -> bpy.types.ShapeKey
```

Creates new shapekey on the body or the passed obj_override from a npz file.

This .npy file contains a one dimensional array with coordinates of the
shape key, RELATIVE to the base coordinates of the body.

Parameters:
- `npz_filepath` (str): Path to the .npz file
- `obj_override` (Optional[Object], default None): Add the shape key to this object instead of to the body object. Defaults to None.

Returns: bpy.types.ShapeKey — bpy.types.ShapeKey: The newly created shape key

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

### as_dict()

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

Get the current shape key and live key values as a dictionary.

Returns: dict[str, float] — dict[str, float]: Dictionary of shape key and live key values

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

### set_from_dict()

```python
human.keys.set_from_dict(key_dict: dict[str, float], context: C = None) -> list[str]
```

Set the shape key and live key values from a dictionary.

Parameters:
- `key_dict` (dict[str, float]): Dictionary of shape key and live key values
- `context` (C, default None): Blender context. Defaults to None.

Returns: list[str] — list[str]: List of errors that occurred during setting the values

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

### update_human_from_key_change()

```python
human.keys.update_human_from_key_change(context: C = None)
```

Update the human mesh from the current live key values.

This is used when updating a live key directly or after changing multiple
livekeys with their `set_without_update` method.

Parameters:
- `context` (C, default None): Blender context. Defaults to None.

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