human

Python representation of a Human Generator human.

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

Attributes
bodyBodySettingsPoints to the body settings of the human.
heightHeightSettingsPoints to the height settings of the human.
faceFaceSettingsPoints to the face settings of the human.
ageAgeSettingsPoints to the age settings of the human.
posePoseSettingsPoints to the pose settings of the human.
animationAnimationSettingsPoints to the animation settings of the human.
clothingClothingSettingsPoints to the clothing settings of the human.
expressionExpressionSettingsPoints to the expression settings of the human.
processProcessSettingsPoints to the class used by the process tab of HumGen.
materialsMaterialSettingsPoints to the class giving access to different materials of human.
objectsObjectCollectionGet a collection of all objects that are part of the human.
childrenIterable[Object]A generator of all children of the rig object of the human.
genderGenderStrGender of this human in ("male", "female").
pose_bonesbpy_prop_collectionPose bones of the human rig.
propsHG_OBJECT_PROPSCustom object properties of the human.
skinSkinSettingsSubclass used to change the skin material of the human body.
keysKeySettingsSubclass used to access and change the shape keys of the body object.
eyesEyeSettingsSubclass used to access and change the eye object and material.
hairHairSettingsSubclass used to access and change the hair systems and materials.
exportExportBuilderSubclass used to export the human.
locationFloatVectorPropertyLocation of the human in Blender global space.
rotation_eulerFloatVectorPropertyEuler rotation of the human in Blender global space.
namestrName of this human. Takes name of rig object and removes HG_ prefix.
is_trialboolWhether this human is a trial human.
Methods
get_preset_options()List[str]Return a list of human possible presets for the given gender.
from_existing()Human | NoneNew instance from a passed Blender object that is part of an existing human.
from_preset()HumanCreates human in Blender based on passed preset and returns Human instance.
get_categories()list[str]Get a list of categories the human presets are divided into.
delete()Delete the human from Blender.
hide_set()Switch between visible and hidden state for all objects of this human.
make_camera_look_at_human()Makes the passed camera point towards a preset point on the human.
save_to_library()Save the human with it's current settings as a starting human preset.
duplicate()HumanMake a copy of this human. Will both duplicate in Blender and Python.
render_thumbnail()strRender a thumbnail of this human.
as_dict()Save these settings to a dict and restore them from one.

Attributes

human.body: BodySettingsread-only

source

Points to the body settings of the human.

Points to the height settings of the human.

human.face: FaceSettingsread-only

source

Points to the face settings of the human.

human.age: AgeSettingsread-only

source

Points to the age settings of the human.

human.pose: PoseSettingsread-only

source

Points to the pose settings of the human.

Points to the animation settings of the human.

Points to the clothing settings of the human.

Points to the expression settings of the human.

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

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

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

human.children: Iterable[Object]read-only

source

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

Does NOT yield subchildren.

human.gender: GenderStrread-only

source

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

human.pose_bones: bpy_prop_collectionread-only

source

Pose bones of the human rig.

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

human.skin: SkinSettingsread-only

source

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

human.keys: KeySettingsread-only

source

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

Iterating yields key_blocks.

human.eyes: EyeSettingsread-only

source

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

human.hair: HairSettingsread-only

source

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

human.export: ExportBuilderread-only

source

Subclass used to export the human.

human.location: FloatVectorProperty

source

Location of the human in Blender global space.

Retrieved from rig_obj.location

human.rotation_euler: FloatVectorProperty

source

Euler rotation of the human in Blender global space.

Retrieved from rig_obj.rotation_euler

human.name: str

source

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

human.is_trial: boolread-only

source

Whether this human is a trial human.

Methods

Human.get_preset_options(gender: GenderStr, category: str = 'All', context: C = None) → List[str]static method

source

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

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

ParameterTypeDescription
genderGenderStrstring in ('male', 'female')
categorystr
default 'All'
Category to find presets for. Defaults to 'All'. You can get a list of all categories by calling Human.get_categories()
contextC
default None
Blender context, uses bpy.context if not passed

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

Human.from_existing(existing_human: Object, strict_check: bool = True) → Human | Noneclass method

source

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

ParameterTypeDescription
existing_humanObjectObject that is part of the human you want to get.
strict_checkbool
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 | 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.

Human.from_preset(preset: str, context: C = None, prettify_eevee: bool = True, from_batch_generator: bool = False) → Humanclass method

source

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

ParameterTypeDescription
presetstrThe name of the preset, as retrieved from Human.get_preset_options()
contextC
default None
The Blender context. Defaults to bpy.context if None
prettify_eeveebool
default True
If True, the AO and Strip settings will be set to settings that look nicer. Defaults to True
from_batch_generatorbool
default False
If True, some settings will be skipped as they are defined in the batch generator. Defaults to False

Returns Human — A Human instance

Human.get_categories(gender: GenderStr) → list[str]static method

source

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

ParameterTypeDescription
genderGenderStrGender to find categories for

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

human.delete()

source

Delete the human from Blender.

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

human.hide_set(state: bool)

source

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

ParameterTypeDescription
stateboolUse True for hidden, False for visible

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

source

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

ParameterTypeDescription
obj_cameraObjectCamera object
look_at_correctionfloat
default 0.9
Correction based on how much lower to point the camera compared to the top of the armature

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

source

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

Will add it to the content library.

ParameterTypeDescription
namestrName of the preset
categorystr
default 'Custom'
Category of the preset, defaults to "Custom". Creates new category if it doesn't exist yet.
thumbnailOptional[Image]
default None
Image to use as thumbnail for the preset. If None no thumbnail will be added.
contextC
default None
The context of the current scene.

human.duplicate(context: C = None) → Human

source

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

All relations will be corrected:

ParameterTypeDescription
contextC
default None
The context of the current scene.

Returns Human — The duplicated human as Python instance.

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

source

Render a thumbnail of this human.

ParameterTypeDescription
folderOptional[str]
default None
Folder to save the thumbnail to. If None the default folder will be used.
namestr
default 'temp_thumbnail'
Name of the thumbnail. Will be used as filename.
focusstr
default 'full_body_front'
Focus of the thumbnail. Can be one of: "full_body_front", "full_body_side", "head_front", "head_side".
contextC
default None
The context of the current scene.
resolutionint
default 256
Resolution of the thumbnail. Defaults to 256.
white_materialbool
default False
Use a white material for the human. Defaults to False.

Returns str — Path to the rendered thumbnail.

Serialization: as_dict

human.as_dict() → dict[str, Any]

source

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.