Commit Graph
57 Commits
Author SHA1 Message Date
Leonardo Zide 3db4b8e70b Preserve ancestor steps while editing nested submodels
Drilling into a child deactivated its parent and evaluated the parent at
its final step. After navigating to an earlier step, this moved surrounding
geometry and separated the child's editing transform from its placement.

Keep the complete editing path active at its chosen steps, and use that
path when filtering ancestor geometry for rendering. Rebuild the transform
from the selected instances when restoring a tab so changes in an ancestor's
own tab also keep the editing target aligned. Returning through a breadcrumb
deactivates only departed descendants; ending editing restores completed
assembly poses while retaining stored step choices.

Also route Submodel Properties to the model currently being edited rather
than the tab model.

Validated the macOS Qt 6 application build, all 8 Qt Test cases, and 106
focused compiled-application checks covering ancestor poses and visibility,
properties edits, tab switching, breadcrumbs, focus status, and exports.
2026-10-24 13:16:12 -07:00
Leonardo Zide baae697960 Fix in-place submodel editing context and navigation
In-place editing could use the tab model's step and focus, lose its active
state after switching tabs, or resolve a nested instance through the wrong
parent. Entering before the final animation key also moved geometry when
drilling into a child.

Use the edited model for step controls, step edits, visibility, and focus
coordinates. Restore that editing target when returning to its tab, include
animation keys and finite hide steps in the last step, and retain the
selected instance path and transforms during nested editing.

Show the editing path only during in-place edits, with links to ancestors
and a close control to return to the tab model. Stack Find/Replace beneath
it and preserve full names in accessible text and tooltips. Add translated
source entries without changing existing translations.

Add a regression test for final-key tracking through time and key edits.
Validated with the macOS Qt 6 application build, all 8 Qt Test cases, and
51 focused checks against the compiled application for steps, tab switching,
focus status, breadcrumbs, and Find/Replace layout. Visually checked the
viewport overlay and its placement during nested editing.
2026-10-24 12:39:25 -07:00
Leonardo Zide f7ab4170dd Finish active drags before executing commands
Keyboard edits during dragging started a new history sequence and discarded the drag's original undo state. Deleting the dragged piece also left tracking active with a dangling piece pointer, causing the next mouse move to crash.

Accept the active drag before dispatching every command except Cancel, which retains its existing cancellation behavior. Keyboard edits and deletion then run as separate undoable operations after tracking has ended.

Validation: macOS application build and Qt Test suite passed. An offscreen harness using the production view, model, and command handlers reproduced the Delete crash and lost drag undo state before the fix. The fixed version passed five runs each of Delete with continued mouse movement, keyboard movement with undo, and Cancel.

Fixes #1046
Fixes #1048
2026-10-21 11:37:19 -07:00
Leonardo Zide 61be531444 Manage piece data ownership with scoped asset references
Replace manual piece-data retain/release bookkeeping with shared copyable
asset-reference handles. Pieces, models, selection, minifigs, thumbnails,
and stored insertion previews retain their dependencies explicitly, while
transient queries continue to borrow pointers.

Separate registered lookup and acquisition from asynchronous load requests
and explicit readiness waits. Keep loader-held references through work and
notification delivery, resetting shared request handles on the UI thread
and guarding callback-triggered library teardown.

Validated with the Qt 6.10 debug build and 26 offscreen lifecycle checks,
including cancellation, stale requests, copy/move operations, model/preview
teardown, undo, project merge/export, and loader shutdown.
2026-10-19 10:02:26 -07:00
Leonardo Zide 7bc6c018b1 Rename PieceInfo to lcPieceData
Use PieceData consistently for the shared part/model record, its related
APIs and variables, and its source files. Keep the existing reference
counting and loading behavior so ownership and readiness changes can be
reviewed separately.
2026-10-18 23:22:28 -07:00
Leonardo Zide 78fe37515c Add selection outlines with obscured geometry fill
Render selected pieces with an outline above scene geometry and a faint selection-colored fill only over obscured portions. Preserve line-only selection colors and insertion preview tint, and suppress bounding box corners in outline mode.

Keep the existing tint and edges mode as a preference and fallback when outline rendering is unavailable. Own outline framebuffers in each view, keep OpenGL operations in lcContext, and capture selection visibility before the grid through a callback scoped to each scene draw.

Validation: debug build and desktop OpenGL checks passed for occlusion, transparency, MSAA, HiDPI, line-only selection, framebuffer fallback, grid exclusion, and widget resource cleanup.
2026-10-10 15:54:13 -07:00
Leonardo Zide 6438bf2682 Expand far clipping distance when fitting large models
Large models can extend beyond the default far plane after fitting,
leaving the view blank or clipped. Pass an explicit adjustment flag
through view, model, and camera fitting, and reuse the fitted bounds
to expand clipping with a margin, rounded up to multiples of 10,000.

Adjust restored ordinary cameras after applying their saved state.
Preserve named cameras and explicit command-line clipping planes,
and avoid recalculating clipping during redraws or navigation.

Route output fitting through the view and move the bounds policy
definition out of the precompiled header.
2026-10-09 15:00:18 -07:00
Leonardo Zide bd6bd50ecc Require complete geometry for image and 3D exports
Report missing generated meshes and failed image writes, keep thumbnails and interactive geometry using their fallback behavior, and frame command-line images at the requested step or full range. Use explicit mesh loader flags and reject incomplete synthesized meshes. Keep selection and ray tests aligned with the rendered mesh.
2026-09-28 11:39:49 -07:00
Leonardo Zide d6359a063a Show loading placeholders and require complete assets for output
- Draw a shared cube for parts whose meshes or textures are still loading.
- Update model bounds, picking, views, and loading status as assets complete.
- Wait for required assets before thumbnails, screenshots, instructions,
  and geometry exports; report failures instead of rendering placeholders.
- Render and pick direct geometry in external projects.
- Defer shared buffer repacking until pending loads finish.
2026-09-26 16:06:20 -07:00
Leonardo Zide a68e7ba02c Add trackball and camera-plane object rotation
Add a camera-facing rotation ring with hover feedback, and replace free XYZ rotation with a trackball interaction. Improve rotation-disc feedback, cursor behavior, snapping, and submodel transform handling.
2026-09-12 20:37:23 -07:00
Leonardo Zide 29e06089a3 Change rotate x/y/z to match camera rotate. 2026-09-07 18:07:54 -07:00
Leonardo Zide c76e03338f Remove dead RotateXY. 2026-09-06 11:08:25 -07:00
Leonardo Zide 90496e9230 Add rotate around camera axis mode. 2026-09-05 22:50:58 -07:00
Leonardo Zide b6f7f92e7e Update all views during piece insert. Fixes #942. 2026-05-06 20:59:46 -07:00
Leonardo Zide 6b84216dd8 Renamed history classes. 2026-03-12 23:12:10 -07:00
Leonardo Zide a8e37df8ce Whitespace cleanup. 2026-03-10 21:11:40 -07:00
Leonardo Zide 069ed47ee9 Fixed text scale on retina displays. 2026-02-14 16:51:49 -08:00
Leonardo Zide c8dca012f9 Replaced bool Ortho with lcCameraProjection::Orthographic for clarity. 2026-02-03 21:46:00 -08:00
Leonardo Zide bbd01f3e4e Removed unused variable. 2026-02-03 09:29:19 -08:00
Leonardo Zide 026a25c8eb Rotate dragged tracks when making new connections. 2025-05-15 17:13:34 -07:00
Leonardo Zide 6059442c6a Fixed color inconsistencies between the different way of adding train tracks. 2025-05-01 20:22:09 -07:00
Leonardo Zide e86208caab Draw train track connection boxes in the manipulator to match the scaling with the other gizmos. 2025-05-01 12:26:34 -07:00
Leonardo Zide 75e6537a22 Use train track connections when dragging new pieces. 2025-04-03 16:23:53 -07:00
Leonardo Zide b9dc71d60e Replaced train track gizmo with a popup list. 2024-12-18 16:41:03 -08:00
Leonardo Zide 4f2782b407 Added rotate train track gizmo. 2024-12-17 19:20:38 -08:00
Leonardo Zide fd61c1c9f9 Added gizmo to rotate train tracks. 2024-11-30 12:29:15 -08:00
Leonardo Zide f80b5c95e1 Code cleanup. 2024-11-26 15:53:50 -08:00
Leonardo Zide ed29dad76a Added train track gizmo. 2024-11-02 19:34:22 -07:00
Leonardo Zide 6a9c2d6a87 Use unique_ptr for cameras. 2024-06-04 09:34:38 -07:00
Leonardo Zide 80d144fea8 Array cleanup. 2024-05-26 13:01:34 -07:00
Leonardo Zide 45ab8e8d60 Update camera menu before showing. 2024-02-19 17:51:34 -08:00
Leonardo Zide cba4dfb468 Added missing tooltips. 2024-01-15 10:18:50 -08:00
Leonardo Zide e061eca2e8 Reorganized spot light parameters. 2023-09-09 18:25:34 -07:00
Trevor SANDY 8cfadc804d Made light type/shape immutable. 2023-08-13 15:50:00 +02:00
Trevor SANDY 3b9ea3ae79 Blender lights - view and control 2023-08-11 05:39:36 +02:00
Leonardo Zide d2f22773e3 Added support for trackpad pan gesture. 2022-05-07 18:46:26 -07:00
Leonardo Zide 275423b512 Fixed gradient background tiles. 2022-04-19 18:06:11 -03:00
Leonardo Zide 6ca5c160f1 Place new pieces relative to the side of the piece under the mouse. 2021-12-24 15:42:37 -08:00
Leonardo Zide 2d315d2ba2 Scan submodels when dragging a new piece into the model. 2021-12-23 17:27:38 -08:00
Leonardo Zide 7d884e6b5f Static analysis fixes. 2021-11-14 18:34:24 -08:00
Leonardo Zide c236ea02bb Moved view manipulator to a separate class. 2021-06-20 11:40:16 -07:00
Leonardo Zide 7a9e193d41 View cleanup. 2021-02-28 11:32:12 -08:00
Leonardo Zide 95fbc13247 Removed GetViewsForModel. 2021-02-27 11:15:04 -08:00
Leonardo f033578abc Keep find next working after closing the find widget. 2021-02-01 14:12:03 -08:00
Leonardo Zide 3bee3a2bcf Removed the find widget part checkbox. 2021-01-31 12:05:15 -08:00
Leonardo Zide b74eb3a81e New find/replace widget. 2021-01-30 15:37:17 -08:00
Leonardo Zide 9a681bff0f Print message when saving files from the command line. 2021-01-10 18:07:27 -08:00
Leonardo Zide dbb4c9e44b QGLWidget cleanup. 2021-01-08 11:25:24 -08:00
Leonardo Zide e6397a98ac Added background override. 2021-01-07 17:04:19 -08:00
Leonardo Zide 47661710db Don't create widgets when saving images from the command line. 2021-01-06 09:55:03 -08:00