Post #5538: Sorry for the wait—great idea, I learned a lot too.

📋 Metadata

🏷️ Tags

popup-dialog macro panel-integration advanced solved

  • Popup Dialog Editor
  • Macro Editor
  • Panel Group Editor
  • Python Scripting

💬 Content

Sorry for the wait—great idea, I learned a lot too.
Pose-mode panels fail in Weight Paint because their poll() checks context.mode == 'POSE'.
Use context.temp_override() to fake Pose mode, then embed the panel in PME by giving it a dummy self that holds PME’s layout (L).

with C.temp_override(
        object=C.pose_object,
        active_object=C.pose_object,
        selected_objects=[C.pose_object],
        mode='POSE'):                       # Blender ≥ 4.4
    dummy = type('DummyPanel', (), {})()
    dummy.layout = L.box()                 # PME layout
    bpy.types.VIEW3D_PT_tools_posemode_options.draw(dummy, C)

Works on my side—give it a try!
Panel drawing test for Pose mode in Weight Paint.json (1.4 KB)

imageimage994×473 95.7 KB


🔗 View on Blender Artists