Add per-object display modes to the Objects panel - #594
Open
markomarkovic wants to merge 10 commits into
Open
Conversation
markomarkovic
force-pushed
the
per-object-visibility
branch
from
July 23, 2026 13:37
aa64b4b to
aa56474
Compare
Contributor
Author
|
Rebased onto master to clear the conflicts with #590. The per-object display modes now work with the nested assembly tree that #590 introduced:
Both entry points to a mode — the radios and the properties editor's dropdown — go through the same path, so either one cascades. New tests cover the nested case: parts get their own radios and hold independent modes, a parent's mode cascades to its subtree, a hidden part stays hidden across a re-run with "Preserve properties on reload", and re-running a script that shows an assembly does not leak radio widgets. |
Introduces the display module: a per-object DisplayMode (Hidden, Wireframe, Transparent, Shaded), a panel-wide GlobalMode override, and effective_mode() resolving the two. HIDDEN always wins so an override never unhides an object.
Adds a per-object Display mode property (Hidden/Wireframe/Transparent/Shaded) to ObjectTreeItem and a panel-wide global mode on ObjectTree, emitting sigDisplayModesChanged/sigGlobalModeChanged with the resolved effective modes so the viewer can apply them.
Wires the object tree's display-mode signals to the viewer: apply_display_modes erases hidden objects and sets wireframe/shaded/transparency per object, and the Wireframe/Shaded/Transparent toolbar actions drive and reflect the global mode.
Replaces the name-column visibility checkbox with a row of mutually exclusive radios per object (Hidden/Wireframe/Transparent/Shaded) and an 'All' row that sets the global override. Radios are centered under centered header icons, and are torn down with the item so the joining QButtonGroup does not leak it.
markomarkovic
force-pushed
the
per-object-visibility
branch
from
September 5, 2026 12:07
aa56474 to
fee47a2
Compare
This reverts commit 6e5fbc6.
Attaching the four setItemWidget radios inside the insert loop made every later addChild/expandItem walk the view's persistent editor table, so addObjects was quadratic in the object count: the 400-shape render went from 0.23s to 1.28s locally and past the 2s test bound on CI. Inserting and expanding every item first and attaching the radios afterwards brings it back to 0.36s. The finally keeps items already added before a failing object (the partial-add case test_render_colors checks) with their radios.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds per-object display modes to the Objects panel. Each object can be shown as shaded, transparent, or wireframe, or hidden, chosen from a row of radios in the tree. An All row applies a single mode to every object at once as a global override, while each object keeps its own mode underneath.
Testing
New
tests/test_display.pycovers the state model;tests/test_app.pyadds pytest-qt coverage for the tree state, viewer application, and the panel radios. The existingtest_inspectwas updated for the new "All" row and the radio-based visibility control.pytest tests/— full suite passes.Depends on #593 — this branch is stacked on it, so until #593 merges the diff also shows the
main_window.pyLogViewer fix.Claude AI assisted with the implementation under my direction; design, testing, and review are mine.