Inherits from PreviewCollectionContent

Class for changing patterns on individual clothing items.

Methods
set()Loads passed pattern on passed object.
set_random()Set a random pattern as active on the passed object.
remove()Remove pattern from passed object.
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

Methods

human.clothing.footwear.pattern.set(preset: str, obj: bpy.types.Object)

source

Loads passed pattern on passed object.

NOTE: Expects passed object to use HG clothing material.

ParameterTypeDescription
presetstrRelative path of pattern to load.
objbpy.types.ObjectObject to apply pattern to.

human.clothing.footwear.pattern.set_random(obj: bpy.types.Object, context: C = None)

source

Set a random pattern as active on the passed object.

ParameterTypeDescription
objbpy.types.ObjectObject to add pattern to.
contextC
default None
Blender context. bpy.context if not provided.

human.clothing.footwear.pattern.remove(obj: bpy.types.Object)

source

Remove pattern from passed object.

ParameterTypeDescription
objbpy.types.ObjectObject to remove pattern from.

human.clothing.footwear.pattern.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.clothing.footwear.pattern.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.clothing.footwear.pattern.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.