KeySettings
human/keys/keys.pyClass for changing the shape keys and LiveKeys of this human.
| Attributes | ||
|---|---|---|
| all_keys | List[Union[LiveKeyItem, ShapeKeyItem]] | A list of all ShapeKeyItems and LiveKeyItems of this human. |
| all_livekeys | List[LiveKeyItem] | A list of all LiveKeyItems of this human. |
| all_shapekeys | List[ShapeKeyItem] | A list of all ShapeKeyItems of this human. |
| all_added_shapekeys | List[ShapeKeyItem] | A list of all ShapeKeyItems that were added by the user or converted from lk. |
| all_deformation_shapekeys | List[ShapeKeyItem] | A list of ShapeKeyItems that are used for deformation. |
| temp_key | bpy.types.ShapeKey | The temporary shape key used for livekeying. Points to the Blender key. |
| permanent_key | bpy.types.ShapeKey | The permanent shape key used for livekeying. Points to the Blender key. |
| Methods | ||
| fold_temp_key() | Moves the shape of the temporary live key into the permanent live key. | |
| get() | Optional[Union[ShapeKeyItem, LiveKeyItem]] | — |
| filtered() | List[Union[LiveKeyItem, ShapeKeyItem]] | Get all keys that match the given category and subcategory. |
| load_from_npz() | bpy.types.ShapeKey | Creates new shapekey on the body or the passed obj_override from a npz file. |
| update_human_from_key_change() | Update the human mesh from the current live key values. | |
| as_dict() · set_from_dict() | Save these settings to a dict and restore them from one. | |
Attributes
human.keys.all_keys: List[Union[LiveKeyItem, ShapeKeyItem]]read-only
sourceA list of all ShapeKeyItems and LiveKeyItems of this human.
human.keys.all_livekeys: List[LiveKeyItem]read-only
sourceA list of all LiveKeyItems of this human.
human.keys.all_shapekeys: List[ShapeKeyItem]read-only
sourceA list of all ShapeKeyItems of this human.
human.keys.all_added_shapekeys: List[ShapeKeyItem]read-only
sourceA list of all ShapeKeyItems that were added by the user or converted from lk.
human.keys.all_deformation_shapekeys: List[ShapeKeyItem]read-only
sourceA 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.
The temporary shape key used for livekeying. Points to the Blender key.
human.keys.permanent_key: bpy.types.ShapeKeyread-only
sourceThe permanent shape key used for livekeying. Points to the Blender key.
Methods
human.keys.fold_temp_key()
sourceMoves 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.
human.keys.get(name: str) → Optional[Union[ShapeKeyItem, LiveKeyItem]]
sourceNo description yet.
| Parameter | Type | Description |
|---|---|---|
| name | str | — |
Returns Optional[Union[ShapeKeyItem, LiveKeyItem]]
human.keys.filtered(category: str, subcategory: Optional[str] = None) → List[Union[LiveKeyItem, ShapeKeyItem]]
sourceGet all keys that match the given category and subcategory.
| Parameter | Type | Description |
|---|---|---|
| category | str | The category to filter for. |
| subcategory | Optional[str] default None | The subcategory to filter for. |
Returns List[Union[LiveKeyItem, ShapeKeyItem]] — List[Union[LiveKeyItem, ShapeKeyItem]]: List of all keys matching the filter
human.keys.load_from_npz(npz_filepath: str, obj_override: Optional[Object] = None) → bpy.types.ShapeKey
sourceCreates 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.
| Parameter | Type | Description |
|---|---|---|
| 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
human.keys.update_human_from_key_change(context: C = None)
sourceUpdate 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.
| Parameter | Type | Description |
|---|---|---|
| context | C default None | Blender context. Defaults to None. |
Serialization: as_dict, set_from_dict
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
human.keys.set_from_dict(key_dict: dict[str, float], context: C = None) → list[str]
sourceSet the shape key and live key values from a dictionary.
| Parameter | Type | Description |
|---|---|---|
| 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