human.hair.regular_hair

RegularHairSettings

human/hair/regular_hair.py

Inherits from ImportableHair

Class for manipulating regular (head) hair of human.

Attributes
lightnessNodeInput—from BaseHair
rednessNodeInput—from BaseHair
roughnessNodeInput—from BaseHair
salt_and_pepperNodeInput—from BaseHair
rootsNodeInput—from BaseHair
root_lightnessNodeInput—from BaseHair
root_rednessNodeInput—from BaseHair
roots_hueNodeInput—from BaseHair
fast_or_accurateNodeInput—from BaseHair
hueNodeInput—from BaseHair
particle_systemsPropCollectionGet propcollection of particle systems on the human used by this hair type.from BaseHair
modifiersPropCollectionModifiers associated with the particle systems of this hair type.from BaseHair
haircard_objOptional[bpy.types.Object]Blender object of haircards IF generated.from BaseHair
materialslist[bpy.types.Material]List of materials used for this type of hair.from BaseHair
nodesPropCollectionPropCollection of nodes used in the materials for this type of hair. # noqafrom BaseHair
Methods
convert_to_haircards()bpy.types.ObjectConvert the hair of this type to haircards.from BaseHair
get_evaluated_particle_systems()PropCollectionGet an evaluated version of the particle systems of this hair type.from BaseHair
delete_all()—from BaseHair
randomize_color()Randomize the color of the hair of this type.from BaseHair
set()Loads hair system the user selected.from ImportableHair
save_to_library()Save the currently active hair system of this type to the HG library.from ImportableHair
remove_all()Remove all modifiers of this hair type from the human.from ImportableHair
randomize()Pick a random hairstyle from the library and apply it to the human.from ImportableHair
set_random()Set this content type to a random content item.from PreviewCollectionContent
get_options()List[str]Get a list of options you can use for the set() method of this content.from PreviewCollectionContent
get_categories()list[str]Get a list of categoris this content type is organized in.from PreviewCollectionContent
refresh_pcoll()Refresh the items of this preview collection.from PreviewCollectionContent
save_objects_optimized()Saves the passed objects as a new blend file.from SavableContent
remove_number_suffix()strRemove the number suffix from the passed name (i.e. Box.004 becomes Box).from SavableContent
as_dict()Save these settings to a dict and restore them from one.

Attributes

human.hair.regular_hair.lightness: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.redness: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.roughness: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.salt_and_pepper: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.roots: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.root_lightness: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.root_redness: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.roots_hue: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.fast_or_accurate: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.hue: NodeInputfrom BaseHair

source

No description yet.

human.hair.regular_hair.particle_systems: PropCollectionread-onlyfrom BaseHair

source

Get propcollection of particle systems on the human used by this hair type.

human.hair.regular_hair.modifiers: PropCollectionread-onlyfrom BaseHair

source

Modifiers associated with the particle systems of this hair type.

human.hair.regular_hair.haircard_obj: Optional[bpy.types.Object]read-onlyfrom BaseHair

source

Blender object of haircards IF generated.

human.hair.regular_hair.materials: list[bpy.types.Material]read-onlyfrom BaseHair

source

List of materials used for this type of hair.

Usually singleton, but will contain multiple values if haircards are generated.

human.hair.regular_hair.nodes: PropCollectionread-onlyfrom BaseHair

source

PropCollection of nodes used in the materials for this type of hair. # noqa

Methods

human.hair.regular_hair.convert_to_haircards(quality: Literal['ultra', 'high', 'medium', 'low', 'haircap_only'] = 'high', context: C = None, triangle_budget: Optional[int] = None) → bpy.types.Objectfrom BaseHair

source

Convert the hair of this type to haircards.

Will generate a mesh object consisting of a haircap and haircards, skinned to the rig of the human. For eye systems only a haircap will be generated. The object follows the expressions of the human.

ParameterTypeDescription
qualityLiteral['ultra', 'high', 'medium', 'low', 'haircap_only']
default 'high'
Quality of the haircards, which sets the number of triangles of the generated object. Defaults to high.
contextC
default None
Blender context. bpy.context if not provided.
triangle_budgetOptional[int]
default None
Maximum number of triangles of the generated object, overrides the budget of the quality.

Returns bpy.types.Object — bpy.types.Object: Blender object of the haircap and haircards

Raises HumGenException — If this human has no hair of this type to convert.

human.hair.regular_hair.get_evaluated_particle_systems(context: C = None) → PropCollectionfrom BaseHair

source

Get an evaluated version of the particle systems of this hair type.

ParameterTypeDescription
contextC
default None
Blender context. bpy.context if not provided.

Returns PropCollection — PropCollection of evaluated particle systems

human.hair.regular_hair.delete_all()from BaseHair

source

No description yet.

human.hair.regular_hair.randomize_color()from BaseHair

source

Randomize the color of the hair of this type.

human.hair.regular_hair.set(preset: str, context: C = None)from ImportableHair

source

Loads hair system the user selected.

ParameterTypeDescription
presetstrName of the preset to load. Must be in the preview collection. Options can be retreived from `get_options()`.
contextC
default None
Blender context. bpy.context if not provided.

human.hair.regular_hair.save_to_library(particle_system_names: list[str], hairstyle_name: str, category: str, for_male: bool = True, for_female: bool = True, thumbnail: Optional[Image] = None, context: C = None)from ImportableHair

source

Save the currently active hair system of this type to the HG library.

ParameterTypeDescription
particle_system_nameslist[str]Names of the particle systems to save.
hairstyle_namestrName to save this hairstyle as.
categorystrCategory to save this hairstyle in. If this category does not already exist, a new folder will be created.
for_malebool
default True
Whether this hairstyle is available for male humans.
for_femalebool
default True
Whether this hairstyle is available for female humans.
thumbnailOptional[Image]
default None
Thumbnail to save with this hairstyle. Pass a Blender Image object here. If None, no thumbnail will be used.
contextC
default None
Blender context. bpy.context if not provided.

human.hair.regular_hair.remove_all()from ImportableHair

source

Remove all modifiers of this hair type from the human.

human.hair.regular_hair.randomize(context: C = None)from ImportableHair

source

Pick a random hairstyle from the library and apply it to the human.

ParameterTypeDescription
contextC
default None
Blender context. bpy.context if not provided.

human.hair.regular_hair.set_random(context: C = None, update_ui: bool = False)from PreviewCollectionContent

source

Set this content type to a random content item.

This will use random.choice to select a random item from the output of get_options().

ParameterTypeDescription
contextC
default None
Blender context. bpy.context if not provided.
update_uibool
default False
Will also show the chosen item as the active thumbnail in the template_icon_view. Defaults to False.

human.hair.regular_hair.get_options(context: C = None, category: str = 'All') → List[str]from PreviewCollectionContent

source

Get a list of options you can use for the set() method of this content.

These represent the choises the user sees in the UI. The output is a list of relative paths to the content files, starting from the Human Generator folder.

ParameterTypeDescription
contextC
default None
Blender context. bpy.context if not provided.
categorystr
default 'All'
Category to filter the content by. Defaults to "All". You can get a list of categories from the get_categories() method.

Returns List[str] — List[str]: List of relative paths to content files. You can pick one of these and pass it to the set() method.

Raises ValueError — If the passed category is not present in the list of categories.

Raises HumGenException — If no options can be found, this can be caused by the content pack for this type of content not being installed.

human.hair.regular_hair.get_categories() → list[str]from PreviewCollectionContent

source

Get a list of categoris this content type is organized in.

You can choose one of these categories to filter the content retreived from get_options().

Returns list[str] — list[str]: List of categories. These are the names of the folders the content is saved in.

human.hair.regular_hair.refresh_pcoll(context: C = None, override_category: Optional[str] = None, ignore_searchterm: bool = False)from PreviewCollectionContent

source

Refresh the items of this preview collection.

This is low level functionality, you should not need to use this. It is used to refresh the list of possible content for this human. If you use get_options() this is automatically done for you.

ParameterTypeDescription
contextC
default None
Blender context. bpy.context if not provided.
override_categoryOptional[str]
default None
Override the category to use, if not provided all items regardless of category will be shown.
ignore_searchtermbool
default False
If True, the searchterm set by the user will be ignored. Defaults to False.

RegularHairSettings.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

source

Saves the passed objects as a new blend file.

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

ParameterTypeDescription
contextbpy.types.ContextBlender context.
objsIterable[bpy.types.Object]List of objects to save
folderstrFolder to save the file in
filenamestrName to save the file as
clear_skbool
default True
Remove all shapekeys from objs. Defaults to True.
clear_materialsbool
default True
Remove all materials from objs. Defaults to True.
clear_vgbool
default True
Remove all vertex groups from objs. Defaults to True.
clear_psbool
default True
Remove all particle systems from objs. Defaults to True.
run_in_backgroundbool
default True
Open the new subprocess in the background. Defaults to True.
clear_driversbool
default True
Remove all drivers from objs. Defaults to True.

RegularHairSettings.remove_number_suffix(name: str) → strstatic methodfrom SavableContent

source

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

ParameterTypeDescription
namestrname to remove suffix from

Returns str — name without suffix

Serialization: as_dict

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

source

Returns dict of eyebrow settings.

Returns dict[str, Any] — dict[str, Any]: Dict of regular hair settings