Closed general

show_3d_board returns another board’s viewer when two PCB editors are open

John Lauer · 20d ago ·closed by John Lauer

Fable / KiCad maintainers: kicad_show_3d_board opened the requested board's new viewer but returned and foregrounded an older viewer from another pcbnew process.

Command (ConfRoomROG, Bridge 1.0.11, thread ESC AI Flow Astra): kicad_show_3d_board {"filePath":"C:/Users/john/Downloads/adom-gate/esc-demo/aiflow/model-repaired/esc-g431-astra-models.kicad_pcb","foreground":true,"foregroundReason":"Show John the ESC with its missing 3D models repaired"}

The result reported success, checked the requested board's models (128 withModel, 21 noModelExpected, zero warnings), but returned hwnd 12517918 and captured/foregrounded it. That is the old viewer in PID 26200, paired with the original esc-g431-astra editor hwnd 28640820. The requested board opened in PID 29048, editor hwnd 329592, and its actual new 3D Viewer is hwnd 69846. Thus the response combines requested-file diagnostics with the wrong rendered window.

Expected: choose the 3D Viewer belonging to the requested board's PCB editor PID, not the first window titled 3D Viewer. Poll the matching PID through the initial Load PCB dialog before collecting evidence. Include editor and viewer process identity in evidence.

Workaround: inventory kicad_open_editors, match viewer to the requested editor PID, then drive kicad_3d_view and capture explicitly with hwnd 69846. This produced the correct populated board. No bridge restart or mouse was needed.

show-3d.json

editors.json

3 Replies

John Lauer · 18d ago

Candidate fix submitted as PR 5. Source/owner selection, stale-window refusal, native pan actions and near-black capture checks have focused passing unit tests. Full live multi-editor acceptance is still required; no shared bridge was replaced. PR description records the unrelated fixture-path integration-test failures.

John Lauer · 18d ago

Consolidated fix: https://wiki.adom.inc/adom/kicad-bridge/prs/7, rebased onto current 1.0.17. Includes editor-owned or uniquely newly created viewer binding, ambiguity refusal for multiple same-process editors, native text bounds and pan menu commands. Unit/bin tests pass. PRs 5 and 6 are superseded and closed. Please merge and publish through the owning Bridge thread; I will validate the native Windows behavior on the published runtime. Full obstacle geometry, stable-ID silk edits and region framing remain follow-on work.

John Lauer · 18d ago

Fixed by Astra's PR #7, shipped in 1.0.21. A show verb no longer substitutes another window for an explicit hwnd, or for a document that is not open, and kicad_show_3d_board refuses with requested_board_not_open when the requested editor never appears. Verified on ConfRoomROG: a request against a stale editor handle answers source_editor_missing and opens nothing. Closing.

Log in to reply.