Logo   Home Table of Contents    News  Dev Blogs  Gallery  Timeline  Legend  Tags 
Join us on... 
Banner

Current: Month Day, Year

9.3.4 Asset Selection Filter JSON file

The selection_filter.json file defines the filtering and categorization system for asset libraries in MakeHuman2. It provides a structured way to organize and search through large collections of assets like clothing, hair, poses, expressions, and rigs by defining hierarchical categories, tag mappings, and quick-access shortcuts. This system enables users to efficiently browse and filter assets using a tree-based navigation menu, shortcut buttons, and intelligent tag processing that automatically categorizes assets based on their metadata.

File Locations and loading order

Each asset type has its own selection_filter.json file: <SystemDir>/data/<asset-type>/<basename>/selection_filter.json Where: Examples: data/clothes/hm08/selection_filter.json data/hair/hm08/selection_filter.json data/poses/hm08/selection_filter.json data/expressions/hm08/selection_filter.json data/rigs/hm08/selection_filter.json

It can be overwritten from User folder:

<UserDataDir>/data/<asset-type>/<basename>/selection_filter.json

User files completely replace system files (not merged). Loading Priority:

  1. Check user directory: <UserDataDir>/data/<asset-type>/<basename>/selection_filter.json
  2. Fall back to system: <SystemDir>/data/<asset-type>/<basename>/selection_filter.json
  3. Use empty filters: If neither exists, no filtering is applied

File Structure

The file consists of up to four main sections: { "CategoryName": ["value1", "value2", "value3"], "NestedCategory": { "Subcategory1": ["item1", "item2"], "Subcategory2": { "DeepCategory": ["deeper1", "deeper2"] } }, "Translate": { "old-tag": "=new-category:new-value", "alias-tag": "category:subcategory", "remove-tag": null }, "GuessName": { "keyword": "category:subcategory:value" }, "Shortcut": [ ["icon.png", "filter-expression", "Display Name"] ] }

Category Definitions

Categories form the hierarchical tree structure displayed in the filter panel. Each category can be flat (array) or nested (object).

Flat Categories

Simple one-level categories with a list of values: "Gender-Age": ["Unisex-Adult", "Male", "Female", "Child", "Baby"] Creates: Gender-Age ├─ Unisex-Adult ├─ Male ├─ Female ├─ Child └─ Baby

Nested Categories

Multi-level hierarchies using nested objects: "Slot": { "Head-Neck": { "Eyes-Face": ["Glasses", "Mask"], "Headgear": ["Hat", "Cap", "Helmet"], "Neck": ["Scarf"] }, "Top-Torso": { "Layer1": ["Bra", "Tanktop", "Swimwear"], "Layer2": ["Shirt", "Sweater", "Pullover"] } } Creates: Slot ├─ Head-Neck │ ├─ Eyes-Face │ │ ├─ Glasses │ │ └─ Mask │ ├─ Headgear │ │ ├─ Hat │ │ ├─ Cap │ │ └─ Helmet │ └─ Neck │ └─ Scarf └─ Top-Torso ├─ Layer1 │ ├─ Bra │ ├─ Tanktop │ └─ Swimwear └─ Layer2 ├─ Shirt ├─ Sweater └─ Pullover

Tag Path Format

Items in the tree create filter tags with colon-separated paths:
Tree PathGenerated Tag
Gender-Age > Malegender-age:male
Slot > Top-Torso > Layer2 > Shirtslot:top-torso:layer2:shirt
Era > Contemporaryera:contemporary
Note: All tags are converted to lowercase for matching.

Translate Section

The Translate section maps old or informal tags to formal category paths. This helps with legacy assets, common misspellings, or user-friendly aliases.

Syntax

"Translate": { "source-tag": "transformation" } Transformation type: Complete Replacement (=)

Replace the tag entirely with a new category path:

"unisex": "=gender-age:unisex-adult", "vintage": "=era:past", "hats": "=slot:head-neck:headgear:hat" Effect: Transformation type: Prepend Category

Add category prefix to existing tag:

"short": "style" Effect: Transformation type: Remove Tag (null)

Remove unwanted tags entirely:

"unisex": null, "hair": null Effect:

Examples

Clothing Example: "Translate": { "unisex": "=gender-age:unisex-adult", "vintage": "=era:past", "hats": "=slot:head-neck:headgear:hat", "lingerie": "=slot:top-torso:layer1:bra" } Hair Example: "Translate": { "unisex": null, "hair": null, "short hair": "=style:short", "ladies": "=gender-age:female", "mens": "=gender-age:male" } Poses Example: "Translate": { "Game": "=situation:reference-pose", "Action": "=activity:fighting" }

GuessName Section

The GuessName section automatically assigns tags to assets based on keywords found in the asset's filename or name.

Syntax

"GuessName": { "keyword-in-name": "category:subcategory:value" } When an asset is loaded, the system:
  1. Checks if any GuessName keyword appears in the asset name (case-insensitive)
  2. If found, automatically adds the specified tag to the asset
  3. This happens in addition to any tags already defined in the asset's metadata

Examples

Clothing Example: "GuessName": { "suit": "slot:top-torso:layer3:suit" } Effect: Any asset with "suit" in its name (e.g., "business-suit.mhclo", "suit-jacket.mhclo") automatically gets tagged as "slot:top-torso:layer3:suit".

Poses Example:

"GuessName": { "fight": "activity:fighting" Effect: Poses named "fight-stance.mhpose", "fighting-pose.mhpose", etc., automatically get "activity:fighting" tag.

Use Cases

Shortcut Section

The Shortcut section creates quick-access icon buttons that apply complex filter combinations with a single click. These appear as a toolbar above the asset browser.

Syntax

"Shortcut": [ ["icon-file.png", "filter-expression", "Tooltip Text"] ] Each shortcut is a 3-element array:
  1. Icon filename (string): PNG image file for the button
    - Located in data/<asset-type>/icons in system or user area
    - Prefix with "c:" to force common system directory data/icons: "c:common-icon.png"
    - Prefix with "u:" to check user directory data/<asset-type>/icons: "u:user-icon.png"
  2. Filter expression (string): Complex filter logic using special syntax
  3. Tooltip (string): Descriptive text shown on hover

Filter Expression Syntax

Filter expressions use boolean logic to combine multiple criteria:

Basic Filter:

"category:subcategory:value" Example:

"gender-age:female"

Shows only female assets.

AND Operator (&): combine multiple required criteria:

"criteria1&criteria2&criteria3" Example:

"gender-age:female&slot:top-torso:layer1:bra"

Shows female assets that are also bras.

OR Operator (|): Allow any of several criteria:

"criteria1|criteria2|criteria3" Example:

"slot:top-torso:layer1:bra|slot:bottom:layer1:panties"

Shows assets that are either bras or panties.

Combining AND and OR: complex logic using both operators

"required1&required2&(option1|option2)" Example:

"gender-age:female&slot:top-torso:layer1:bra|slot:bottom:layer1:panties"

Shows female assets that are either bras or panties.

Common Shortcuts

Simple Category Shortcuts: ["glasses.png", "slot:head-neck:eyes-face:glasses", "Glasses"], ["hat.png", "slot:head-neck:headgear:hat", "Hat"], ["shirt.png", "slot:top-torso:layer2", "Shirt, Tops"] Gender-Specific Shortcuts: ["f_shoe.png", "slot:feet&gender-age:female|slot:feet&gender-age:unisex-adult", "Shoes (female)"], ["m_shoe.png", "slot:feet&gender-age:male|slot:feet&gender-age:unisex-adult", "Shoes (male)"] Complex Multi-Category Shortcuts: ["lingerie.png", "gender-age:female&slot:top-torso:layer1:bra|slot:bottom:layer1:panties", "Lingerie"], ["maleunderwear.png", "gender-age:male&slot:top-torso:layer1|slot:bottom:layer1:panties", "Male Underwear"]

How Tag Processing Works

Step 1: Asset Loading:

When an asset is loaded, it has tags defined in its metadata (e.g., in .mhclo, .mhpose files):

tags = ["female", "casual", "shirt"]

Step 2: GuessName Processing

Check if asset name contains keywords:

# Asset name: "summer-suit.mhclo" # GuessName: {"suit": "slot:top-torso:layer3:suit"} # Result: Add "slot:top-torso:layer3:suit" to tags Step 3: Translate Processing

Apply tag transformations:

# Original tags: ["female", "casual", "vintage"] # Translate: {"vintage": "=era:past"} # Result: ["female", "casual", "era:past"] Step 4: Category Prepending

For tags matching category values, prepend the category path:

# Original: ["female", "casual"] # Categories: {"Gender-Age": ["Female"], "Occasion": ["Casual"]} # Result: ["gender-age:female", "occasion:casual"] Step 5: Final Tag Set

Asset now has fully qualified tags for filtering:

Final tags: ["gender-age:female", "occasion:casual", "era:past", "slot:top-torso:layer3:suit"]