Answer
props() accesses values registered by PME’s Property Editor. It is useful when several menus need the same user setting or when a Custom item needs a value to control its layout.
value = props("MyProperty")
value = props().MyProperty
props("MyProperty", value)
props().MyProperty = valueThe named read forms return the same registered property. Calling props() with no name returns the property container used by the attribute form.
Usage
Create a Property Editor entry named my_float_property, then use it in a Custom item:
L.scale_x = L.scale_y = props("my_float_property")For an enum property displayed in a custom layout:
L.row().prop(props(), "my_enum_property", expand=True)The setter form returns True when PME accepts a write to a registered property and False when the name is not writable. Reading an unknown name returns None.
Pitfalls
- Define the property in PME’s Property Editor before reading or writing it with
props(); useUfor session scratch values. - Use the property identifier rather than an arbitrary label. PME accepts supported legacy display-name aliases when reading, but writes require a registered storage ID.
props()reads PME preferences. Address the RNA path directly when the target is Blender data.- Registered properties become available after PME has loaded its Property Editor; arbitrary startup code can run earlier.
- Keep the expression type-compatible with the widget. For example,
scale_xexpects a float rather than an enum or string.
The accessor behavior above describes PME 2.1. The linked examples use PME 1.18.x-era naming.