Outcome

Show Blender’s editable X, Y, and Z dimensions in a PME layout, with a useful fallback when no object is active:

L.prop(C.object, "dimensions", text="") if C.object else L.label(text="Select an object")

The fields use Blender’s normal unit display and edit the active object’s standard dimensions property.

Steps

  1. Open a Pie Menu or Popup Dialog in PME.

  2. Add an item and set it to Custom.

  3. Enter the guarded expression:

    L.prop(C.object, "dimensions", text="") if C.object else L.label(text="Select an object")
  4. Apply the item.

  5. Select an object and open the PME menu. The item displays the object’s X, Y, and Z dimensions; edit a field to use it like Blender’s native control.

For a compact aligned row with a little more horizontal room:

row = L.row(align=True); row.scale_x = 0.8; row.prop(C.object, "dimensions", text="") if C.object else row.label(text="Select an object")

The 2021 discussion used PME’s old Interactive Menus workflow to extend an existing Blender menu. In PME 2.1, place the Custom-layout expression directly in a menu.

Pitfalls

  • Keep the if C.object guard. A Pie Menu can be opened with no active object, and L.prop() requires a real Blender data owner.
  • Use a Custom item because L supplies PME’s UILayout object for drawing controls.
  • C.object means the active object in the invocation context, so the expression draws one dimensions row for that object.
  • Blender defines Object.dimensions as the object’s absolute bounding-box dimensions rather than raw mesh vertex extents.
  • Editing dimensions changes Blender’s object property. Constraints, evaluated geometry, and object transforms can affect the resulting size.
  • Very narrow pie slots may compress the three fields. Use a Popup Dialog, shorten the label, or give the row more space when readability matters.

Sources