ShapeKeyItem
human/keys/keys.pyInherits from KeyItem, SavableContent
Item representing a Blender shape key on the human.
| Attributes | ||
|---|---|---|
| category_dict | — | |
| sk_name | — | |
| value | float | Get the current value of the shape key. |
| name | —from KeyItem | |
| category | —from KeyItem | |
| subcategory | —from KeyItem | |
| Methods | ||
| as_bpy() | ShapeKey | Get pointer to the Blender shape key's key_block. |
| save_to_library() | Save this shape key to the Human Generator content library. | |
| draw_prop() | bpy.types.UILayout | Draw the shape key as a slider in the UI. |
| save_objects_optimized() | Saves the passed objects as a new blend file.from SavableContent | |
| remove_number_suffix() | str | Remove the number suffix from the passed name (i.e. Box.004 becomes Box).from SavableContent |
Attributes
ShapeKeyItem.category_dict
sourceNo description yet.
No description yet.
Get the current value of the shape key.
No description yet.
No description yet.
ShapeKeyItem.subcategoryfrom KeyItem
sourceNo description yet.
Methods
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
ShapeKeyItem.save_to_library(name: str, category: str, subcategory: str, as_livekey: bool = True, delete_original: bool = False)
sourceSave 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.
| Parameter | Type | Description |
|---|---|---|
| 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. |
ShapeKeyItem.draw_prop(layout: bpy.types.UILayout, value_propname: Literal['value', 'value_limited', 'value_positive_limited'] = 'value') → bpy.types.UILayout
sourceDraw the shape key as a slider in the UI.
| Parameter | Type | Description |
|---|---|---|
| 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
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 methodfrom SavableContent
sourceSaves the passed objects as a new blend file.
opening the file in the background to make it as small as possible
| Parameter | Type | Description |
|---|---|---|
| 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. |
ShapeKeyItem.remove_number_suffix(name: str) → strstatic methodfrom SavableContent
sourceRemove the number suffix from the passed name (i.e. Box.004 becomes Box).
| Parameter | Type | Description |
|---|---|---|
| name | str | name to remove suffix from |
Returns str — name without suffix