# ShapeKeyItem

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

Inherits from: [KeyItem](https://humgen3d.com/docs/api/keyitem), [SavableContent](https://humgen3d.com/docs/api/savablecontent)

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

Item representing a Blender shape key on the human.

## Attributes

### category_dict

```python
ShapeKeyItem.category_dict
```

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

### sk_name

```python
ShapeKeyItem.sk_name
```

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

### value

```python
ShapeKeyItem.value: float
```

Get the current value of the shape key.

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

### name

```python
ShapeKeyItem.name
```

*inherited from KeyItem*

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

### category

```python
ShapeKeyItem.category
```

*inherited from KeyItem*

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

### subcategory

```python
ShapeKeyItem.subcategory
```

*inherited from KeyItem*

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

## Methods

### as_bpy()

```python
ShapeKeyItem.as_bpy() -> ShapeKey
```

Get pointer to the Blender shape key's key_block.

This is useful for sliders in the UI.

Returns: ShapeKey — Blender shape key's key_block

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

### save_to_library()

```python
ShapeKeyItem.save_to_library(name: str, category: str, subcategory: str, as_livekey: bool = True, delete_original: bool = False)
```

Save this shape key to the Human Generator content library.

This means this shape key will be available for all other characters you create
in Human Generator. Save it as a livekey to save space and to have the rig and
clothing update automatically when you change the key. Save as shape key if
it will be used for animation.

Parameters:
- `name` (str): Name to save the key as
- `category` (str): Category to save the key in. This has to be one of the preset categories. As of writing these are "face_proportions", "body_proportions", "presets", "expressions", and "special".
- `subcategory` (str): Subcategory to save the key in. If the subcategory does not exist, a new folder will be created.
- `as_livekey` (bool, default True): Save as livekey or shape key. Defaults to True.
- `delete_original` (bool, default False): Delete the original key after saving. Defaults to False.

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

### draw_prop()

```python
ShapeKeyItem.draw_prop(layout: bpy.types.UILayout, value_propname: Literal['value', 'value_limited', 'value_positive_limited'] = 'value') -> bpy.types.UILayout
```

Draw the shape key as a slider in the UI.

Parameters:
- `layout` (bpy.types.UILayout): layout to draw the slider in
- `value_propname` (Literal['value', 'value_limited', 'value_positive_limited'], default 'value'): IGNORED for shapekeys. Defaults to "value".

Returns: bpy.types.UILayout — bpy.types.UILayout: layout with the slider drawn in it

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

### save_objects_optimized()

```python
ShapeKeyItem.save_objects_optimized(context: bpy.types.Context, objs: Iterable[bpy.types.Object], folder: str, filename: str, clear_sk: bool = True, clear_materials: bool = True, clear_vg: bool = True, clear_ps: bool = True, run_in_background: bool = True, clear_drivers: bool = True)
```

*static method, inherited from SavableContent*

Saves the passed objects as a new blend file.

opening the file in the background to make it as small as possible

Parameters:
- `context` (bpy.types.Context): Blender context.
- `objs` (Iterable[bpy.types.Object]): List of objects to save
- `folder` (str): Folder to save the file in
- `filename` (str): Name to save the file as
- `clear_sk` (bool, default True): Remove all shapekeys from objs. Defaults to True.
- `clear_materials` (bool, default True): Remove all materials from objs. Defaults to True.
- `clear_vg` (bool, default True): Remove all vertex groups from objs. Defaults to True.
- `clear_ps` (bool, default True): Remove all particle systems from objs. Defaults to True.
- `run_in_background` (bool, default True): Open the new subprocess in the background. Defaults to True.
- `clear_drivers` (bool, default True): Remove all drivers from objs. Defaults to True.

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/common_baseclasses/savable_content.py#L24

### remove_number_suffix()

```python
ShapeKeyItem.remove_number_suffix(name: str) -> str
```

*static method, inherited from SavableContent*

Remove the number suffix from the passed name (i.e. Box.004 becomes Box).

Parameters:
- `name` (str): name to remove suffix from

Returns: str — name without suffix

Source: https://github.com/OliverJPost/HumGen3D/blob/main/human/common_baseclasses/savable_content.py#L152
