Answer
Use a PME Float Property as the UI-facing value, then connect it to Blender data with its Getter and Setter fields. Set the property’s subtype to Factor when the value is a normalized 0–1 control and should look like a slider.
Steps
-
Create a Property Editor entry and choose Float.
-
Set its default, minimum, maximum, and step values to match the target RNA property.
-
Add a Getter that returns the current Blender value. For example:
return C.preferences.themes["Default"].view_3d.face_retopology[3] -
Add a Setter that writes the callback’s
value:C.preferences.themes["Default"].view_3d.face_retopology[3] = value -
Choose Factor for Subtype when the target is a 0–1 factor. Use the target’s actual unit or subtype for other numeric data.
-
Place the property in a Popup Dialog or Custom item and test both reading and dragging it. To expose it through a Panel Group, add the containing Popup Dialog to that group.
Pitfalls
- The Getter must return the current value; returning a label or a code string makes the control display the wrong type.
- The Setter receives
value; assign that value to the Blender property for a two-way control. - The property path must exist in the active Blender version and preferences theme. If a path is version-specific, guard it or choose a more stable target.
- A Factor subtype changes presentation; it does not clamp or convert the underlying Blender value. Set valid minimum and maximum bounds explicitly.
- If the control is visible but does not update, test the target path directly in Blender’s Python Console before debugging PME.
The historical example used the face_retopology theme setting. Choose a property that exists in your Blender build.
The steps above were source-checked with PME 2.1 and Blender 4.5–5.2.