-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or requestui/uxUser interface and experienceUser interface and experience
Milestone
Description
Summary
Add GPU-rendered description tooltips for Pie Menu items - a long-requested PME1 feature finally coming to PME2.
Background
Users have requested the ability to show descriptive text for pie menu items on hover. This is a signature PME2 feature that will enhance usability.
Phase 1: Pie Menu Tooltip (This Issue)
Goal
- GPU-rendered tooltip showing
pmi.descriptionon hover - Pie Menu only (PMENU mode)
- Simple text display near the hovered item
Technical Approach
Architecture:
┌─────────────────────────────────────────────────┐
│ Blender Standard UI │
│ wm.popup_menu_pie() → _draw_pm() │
│ (UILayout-based, existing behavior) │
└─────────────────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────┐
│ GPU Overlay (NEW) │
│ POST_PIXEL draw_handler │
│ - Detect hovered item │
│ - Render description tooltip │
└─────────────────────────────────────────────────┘
Key Components:
- Mouse tracking: Get cursor position during pie menu display
- Hit test: Calculate which slot (0-9) is hovered based on angle/distance
- Tooltip rendering:
gpu(rect) +blf(text) modules - Positioning: Near cursor or item, avoiding screen edge
Key Files:
operators/__init__.py:1137-WM_OT_pme_user_pie_menu_calloperators/__init__.py:1372-_draw_pm()methodinfra/overlay.py- Existing overlay infrastructure
Future Phases (Out of Scope)
Phase 2: Always-Visible Hover UI
- Mini Qt-like widget system
- Persistent panels that don't auto-close
- GPU widget framework (
pme.gfxpackage)
Phase 3: Full Widget Editor
- Visual pie menu editor
- Drag & drop slot arrangement
- Live preview
Implementation Considerations
GPU/BLF Constraints (from analysis)
- Drawing target: Existing Area/Region only (SpaceView3D, etc.)
- Input handling: All via modal operator
- Theme/scaling: Manual calculation required (HiDPI, pixel_size)
- API stability: GPU/BLF signatures change between versions - need adapter layer
Blender API Notes
blf.size()changed in 4.0 (dpi argument removed)gpu.shader.from_builtin()may change- Recommend isolating GPU calls in
pme.gfxorinfra/gpu_utils.py
Recommended Architecture
# infra/gpu_utils.py - Adapter layer for Blender version compatibility
def draw_text(x, y, text, size, color): ...
def draw_rect(x, y, w, h, color): ...
# ui/tooltip.py - Tooltip logic
class PieTooltipRenderer:
def __init__(self, pm): ...
def draw(self, context): ...
def get_hovered_slot(self, mouse_x, mouse_y): ...Related Resources
Internal Documents
_docs/design/user_pie_menu_call_analysis.md- Full operator analysis_docs/design/PME2_FEATURE_REQUESTS.md- User feature requests
Design Decision: Operator Decomposition
Benefits of decomposing WM_OT_pme_user_pie_menu_call:
| Feature Request | Current Problem | After Decomposition |
|---|---|---|
| Custom styling (#3) | 200-line _draw_item, changes hard to trace |
ui/item_style.py isolates style logic |
| Modal operator enhancement (#8) | 524-line state machine | operators/modal/state_machine.py |
| Context-aware menus (#5) | poll/draw tightly coupled | core/context_rules.py |
Recommendation: Consider _draw_item separation (Phase WM-1) before or alongside tooltip implementation.
JSON Schema v2 Integration
{
"items": [
{
"text": "Add Cube",
"description": "Add a cube primitive to the scene",
"description_expr": "'Objects: ' + str(len(C.scene.objects))"
}
]
}description: Static text (i18n-translatable)description_expr: Python expression for dynamic text
See: #81 (description/description_expr implementation)
🎉 Milestone Issue #100 - A signature feature for PME2!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestui/uxUser interface and experienceUser interface and experience