Historical example · current workflow unverified The source author reported this working with Blender 4.4 or later. The underlying
temp_override()and Custom layout mechanisms still exist, but this exact panel-and-mode combination was not rerun for this guide.
Outcome
Show Blender’s Pose-mode display-options panel inside a PME Popup Dialog while working in Weight Paint. The pattern temporarily supplies the context the native panel’s poll() expects, then gives its draw() method a layout owned by PME.

Historical Custom-item pattern
Place the code in a Custom item where L is the PME layout:
with C.temp_override(
object=C.pose_object,
active_object=C.pose_object,
selected_objects=[C.pose_object],
mode="POSE"):
dummy = type("DummyPanel", (), {})()
dummy.layout = L.box()
bpy.types.VIEW3D_PT_tools_posemode_options.draw(dummy, C)The linked JSON example captures the original setup.
What the code assumes
- The active object has an associated pose object;
C.pose_objectmust not beNone. - The target Blender panel still has the same class name and accepts the context supplied by the override.
- The current PME item is a Custom layout item, so
Lexists. - The panel’s own controls are meaningful in the original Weight Paint workflow.
temp_override() changes the context only within the with block. It does not make an arbitrary Blender panel generally safe in another editor or mode.
Test before adopting it
- Start with a throwaway Popup Dialog containing only this one Custom item.
- Test with an armature and mesh in the exact Weight Paint setup you use.
- Open Blender’s System Console and stop if the panel’s
poll()ordraw()raises an error. - Check the panel after a Blender upgrade; native panel identifiers and context requirements can change.
Do not use this pattern to bypass a panel’s safety requirements. If a native panel performs an action that still requires Pose mode at execution time, the override may draw it but not make that action valid.
Related
- Use PME’s panel() helper for a native panel that already has a valid context
- Diagnose Blender context and Poll failures
- Create a persistent Panel Group instead of a temporary dialog