Object properties

February 21, 2026 · View on GitHub

Overview

src/mpfb/entities/objectproperties/__init__.py does not define Python classes. Instead, it creates three module-level singleton instances of BlenderConfigSet at import time. Each instance is constructed from a directory of JSON property definition files and manages a distinct set of namespaced Blender custom properties on bpy.types.Object.

The three singletons are:

SingletonPrefixTarget objects
GeneralObjectPropertiesMPFB_GEN_Any MPFB-managed Blender object
HumanObjectPropertiesMPFB_HUM_Basemesh (human body mesh) objects
SkeletonObjectPropertiesMPFB_SKEL_Armature/skeleton objects

The full Blender property key for any property is MPFB_ followed by the instance prefix and the short name, giving patterns like MPFB_GEN_object_type, MPFB_HUM_gender, and MPFB_SKEL_extra_bones.

Values are stored as standard Blender custom properties on the object, so they are serialised with the .blend file automatically. The three instances are semantically scoped:

  • GeneralObjectProperties — general metadata that applies to any object in MPFB (such as basic type, source asset path, UUID, scale, alternative material).
  • HumanObjectProperties — basic human properties for a basemesh (gender, age, body shape, ethnicity...).
  • SkeletonObjectProperties — rig-specific properties of the armature object.

For the complete method reference for all three singletons, see BlenderConfigSet.

Source

src/mpfb/entities/objectproperties/__init__.py

JSON property definitions:

  • src/mpfb/entities/objectproperties/generalproperties/ — one JSON file per GeneralObjectProperties property
  • src/mpfb/entities/objectproperties/humanproperties/ — one JSON file per HumanObjectProperties property
  • src/mpfb/entities/objectproperties/rigproperties/ — one text file documenting extra_bones

Dependencies

DependencyUsage
bpybpy.types.Object — the Blender type all three instances target
osResolves the JSON property directories relative to __file__
LogServiceModule-level trace logging during initialisation
BlenderConfigSetThe class that all three singletons are instances of

GeneralObjectProperties

Blender property prefix: MPFB_GEN_

JSON directory: src/mpfb/entities/objectproperties/generalproperties/

Applies to: Any MPFB-managed Blender object

Short nameFull nameTypeDefaultAliasesDescription
object_typeMPFB_GEN_object_typestring""MhObjectTypeMPFB/MakeHuman object classification. Common values: "Basemesh", "Skeleton", "Clothes", "Eyes", "Hair", "Proxymesh", "Subrig"
asset_sourceMPFB_GEN_asset_sourcestring""Path to the source asset file (e.g. the .mhclo that created a clothes object)
alternative_materialMPFB_GEN_alternative_materialstring""Reference to a non-default material for this object
scale_factorMPFB_GEN_scale_factorfloat1.0MhScaleFactorScale factor at import/creation time, relative to MakeHuman's canonical size
uuidMPFB_GEN_uuidstring""Unique identifier of the source asset

HumanObjectProperties

Blender property prefix: MPFB_HUM_

JSON directory: src/mpfb/entities/objectproperties/humanproperties/

Applies to: Basemesh (human body mesh) objects

Short nameFull nameTypeDefaultDescription
genderMPFB_HUM_genderfloat0.50.0 = fully female, 1.0 = fully male
ageMPFB_HUM_agefloat0.5Age morph blend
muscleMPFB_HUM_musclefloat0.5Muscle-tone morph blend
weightMPFB_HUM_weightfloat0.5Body-mass morph blend
heightMPFB_HUM_heightfloat0.5Height morph blend
proportionsMPFB_HUM_proportionsfloat0.50.0 = wide hips / narrow shoulders, 1.0 = wide shoulders / narrow hips
cupsizeMPFB_HUM_cupsizefloat0.5Breast cup-size morph blend
firmnessMPFB_HUM_firmnessfloat0.5Breast firmness morph blend
africanMPFB_HUM_africanfloat0.333African ethnicity blend
asianMPFB_HUM_asianfloat0.333Asian ethnicity blend
caucasianMPFB_HUM_caucasianfloat0.333Caucasian ethnicity blend
material_sourceMPFB_HUM_material_sourcestring""Path to the skin/material definition file
is_human_projectMPFB_HUM_is_human_projectbooleanfalseTrue if this basemesh was created within MPFB (vs. imported externally). Gates serialisation in HumanService.

SkeletonObjectProperties

Blender property prefix: MPFB_SKEL_ JSON directory: src/mpfb/entities/objectproperties/rigproperties/ Applies to: Armature/skeleton objects

Short nameFull nameTypeDescription
extra_bonesMPFB_SKEL_extra_bonesstring listNames of bones that are generated or added after initial rig creation (e.g. eye-target bones, finger helpers). Ensures their vertex weights are loaded when the rig is recreated.

Note on extra_bones: Unlike the JSON-backed properties above, extra_bones is not defined by a JSON file. It is a raw Blender custom property accessed by key name. Rather than calling get_value / set_value directly, callers use RigService.set_extra_bones / RigService.get_extra_bones, which internally look up the full key via SkeletonObjectProperties.get_fullname_key_from_shortname_key("extra_bones").


Public API

The three singletons share the complete BlenderConfigSet API. Only the most commonly used methods are summarised here. See BlenderConfigSet for the full reference.


get_value(name, default_value=None, entity_reference=None)

Read a property value from a Blender object.

ArgumentTypeDescription
namestrShort name, full prefixed name, or alias
default_valueanyValue to return if the property is not set on the object
entity_referencebpy.types.ObjectThe Blender object to read from

Returns: The property value, or default_value if not set.


set_value(name, value, entity_reference=None)

Write a property value to a Blender object.

ArgumentTypeDescription
namestrShort name, full prefixed name, or alias
valueanyValue to write
entity_referencebpy.types.ObjectThe Blender object to write to

Returns: None


has_key(name)

Check whether a property name is registered in this config set.

ArgumentTypeDescription
namestrShort name, full prefixed name, or alias to check

Returns: boolTrue if the name is known to this config set.


has_key_with_value(name, entity_reference=None)

Check whether a property is registered and has a value stored on the given object.

ArgumentTypeDescription
namestrShort name, full prefixed name, or alias
entity_referencebpy.types.ObjectThe Blender object to inspect

Returns: boolTrue if the property exists and has a value on the object.


get_keys()

Return all registered short property names for this config set.

Returns: list[str] — short names of all registered properties.


get_fullname_key_from_shortname_key(key_name)

Convert a short property name to the full namespaced Blender custom property key.

ArgumentTypeDescription
key_namestrShort property name (e.g. "object_type")

Returns: str — Full key including the MPFB_ prefix and instance prefix (e.g. "MPFB_GEN_object_type").


Examples

Check that an object is a basemesh and read its gender setting:

from mpfb.entities.objectproperties import GeneralObjectProperties, HumanObjectProperties

obj = bpy.context.active_object

if GeneralObjectProperties.get_value("object_type", entity_reference=obj) == "Basemesh":
    gender = HumanObjectProperties.get_value("gender", default_value=0.5, entity_reference=obj)
    print(f"Gender blend: {gender}")

Mark a newly created object as an MPFB Clothes object and record its source file:

from mpfb.entities.objectproperties import GeneralObjectProperties

obj = bpy.context.active_object

GeneralObjectProperties.set_value("object_type", "Clothes", entity_reference=obj)
GeneralObjectProperties.set_value("asset_source", "/path/to/shirt.mhclo", entity_reference=obj)