Commit Graph
132 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 c9f473b1bf Add fading outlines for new-piece highlights
Highlight newly added pieces with the configured highlight color in outline
mode, and widen outlines with an outward opacity falloff. Keep highlight
coverage independent of selection in the existing mask so overlap preserves
selection and focus priority, and limit the obscured fill to selection.
Skip selection visibility and occluder draws in highlight-only scenes while
retaining colored-edge fallback for line meshes and unsupported views.

Rename the shared preference to Highlight Style throughout the UI, renderer,
and persisted settings without migrating the previous key. Update contextual
help and translation catalogs, preserving existing translations and leaving
new text unfinished. Name the selection-only mask draw DrawSelectionMask.

Validation: macOS debug build; desktop OpenGL checks for fading, focus colors,
selection/highlight overlap, occlusion, transparency, MSAA, and edge fallback;
preference round trips; compilation of all nine translation catalogs.

Fixes #461
2026-10-23 23:49:46 -07:00
Leonardo Zide 8eaf3bf71c Fix viewport-relative keyboard transforms
The direction-key mapping compared radian angles with degree thresholds, preventing it from following the viewport reliably. Replace the unprojection and angle tests with a camera-space comparison of the available X/Y axis mappings.

Keep arrow keys in the transform's XY plane and preserve Page Up/Down on Z. Account for relative piece axes, separate transforms, and active submodel rotation, with deterministic diagonal choices and an away/toward fallback in edge-on views.

Closes #777
2026-10-23 15:19:51 -07:00
Leonardo Zide 557c5276bd Use action-specific message box titles
Replace generic application and error titles with the operation that triggered
the message. Reuse translated dialog titles for validation and render errors,
preserve the current submodel naming action, and label edge-color prompts.

Require callers of the shared Blender message helper to provide a title so
installation, updates, extraction, settings, and output messages identify
their action instead of falling back to a product name.

Refresh all eight language catalogs and supply new title translations as
unfinished drafts with provenance comments. Preserve existing translations
and their review status, with drafts still included in release catalogs.

Validation: Qt 6.10 debug build; source and catalog coverage for all 2,058
active messages; existing translation preservation and generic-title checks;
runtime translation and plural checks; git diff --check.
2026-10-22 12:15:34 -07:00
Leonardo Zide 0d137bcf47 Bound grid generation for distant pieces
A piece at an extreme coordinate expands the grid to millions of lines, causing excessive allocations or a truncated vertex buffer size followed by writes past its end. Larger coordinates can also exceed the integer range during conversion.

Clamp finite grid bounds before converting to integers, limiting the vertex buffer to less than 1 MB, and use the default grid for non-finite bounds. Calculate texture extents in floating point to avoid integer overflow with large spacing values.

Fixes #1044
2026-10-20 11:59:34 -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 58f60b9423 Separate asset readiness from loader request progress
Keep piece readiness, mesh publication, and settled synth errors in the
library while the loader manages scheduling, request outcomes, cancellation,
and deferred notifications. Capture synth inputs and base identities at the
library boundary so the loader treats pieces as opaque identities.

Use a shared asset readiness enum for pieces and textures. Keep texture
queueing, decoding, and retry progress in requests, pass resolved sources to
the loader, and centralize texture failure messages in lcTexture. Preserve
scoped wait failure and cancellation results alongside final readiness checks.

Consolidate shared priorities, sources, snapshots, build results, and texture
error codes in lc_assettypes.h, replacing lc_filesource.h. Forward declarations
remove the loader header's piece, library, and texture-manager dependencies.

Validated with the Qt Debug build, header isolation compilation, asset loader
lifecycle and scheduling regression checks, and 14 first/repeat export checks.
2026-10-16 17:42:16 -07:00
Leonardo Zide 3ec8b274b1 Unify asset loading priorities and clarify wait APIs
Replace load flags and the loader's separate priority enum with Low, Normal, and Blocking priorities. Blocking loads wait for completion; asynchronous loads and internal scheduling retain promotion-only behavior.

Acquire consumer references in the library, reuse loader loading for stud-style rebuilds, and remove QueuePiece, single-piece readiness wrappers, and the library texture readiness wrapper. Rename scoped readiness APIs to WaitFor functions and document their scheduling and lifetime contracts.

Validated with a Debug build and a temporary lifecycle harness covering priority promotion, blocking loads, reference cleanup, selective style reloads, cancellation, pause/resume, and shutdown.
2026-10-13 23:27:29 -07:00
Leonardo Zide a84c3d7b7e Clean up shader initialization and preserve optional rendering fallbacks
The fixed-function renderer was removed, but shader capability guards,
bitmap text paths, and legacy attribute state still implied a working
shaderless fallback. Remove that obsolete state and check shader support
once when initializing rendering resources.

Return detailed context and shader errors through lcResult and show fatal
startup errors in GUI mode. Keep lighting, conditional lines, SDF text,
view sphere, and outlines optional, with program validity checks selecting
Flat shading, skipping unavailable overlays, or retaining selection tint.
Non-rendering exports initialize only the context needed for asset loading.

Apply icon availability to every parts list without overwriting requested
sizes. Disable unavailable lighting and view-sphere preference controls,
make attribute aliases explicit, and prevent signed-byte glyph indexing.

Validation: macOS debug build, GUI and image export under forced optional
shader compile/link failures, Flat fallback image comparisons, export
initialization checks, preference preservation, and glyph byte-range checks.
2026-10-11 21:00:12 -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 45de08aaae Propagate framebuffer tile readback failures before copying pixels 2026-10-05 13:33:16 -07:00
Leonardo Zide e780f4a30a Settle assets before insertion and dragging 2026-10-05 12:47:30 -07:00
Leonardo Zide 8ceceb95ba Allow outputs with missing geometry and fit available meshes 2026-10-04 13:57:35 -07:00
Leonardo Zide f4d00bf41d Fix Fade Previous Step affecting thumbnails. Fixes #1035. 2026-09-29 23:27:10 -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 8e2490c4ba Open LDraw and LDD projects without waiting for meshes
Queue model geometry builds and mesh conversion on workers so project opening can return after parsing. Keep complete-asset waits for previews and output, and show project loading progress in the status bar.

Preserve live pieces when project names overlap, restore mappings after failed loads, and include detached pieces in buffer and stud-style updates.
2026-09-27 10:59:34 -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 57332f834e Improve move gizmo feedback 2026-09-21 22:34:18 -07:00
Leonardo Zide 21bdbc9ec0 Improve viewport text and view sphere rendering
Generate SDF glyphs for viewport overlays with configurable text and halo colors. Render view-sphere labels directly on the sphere surface from a compact vertical atlas, fitting translated labels to the printable area. Preserve the bitmap paths when shader objects are unavailable.
2026-09-16 23:03:16 -07:00
Leonardo Zide d61b8aca64 Fix insert preview across model views 2026-09-13 21:42:16 -07:00
Leonardo Zide b67d3d1293 Fix rotation axes for mirrored transforms 2026-09-13 21:36:54 -07:00
Leonardo Zide 4ddeab6a0b Draw trackball hover indicator. 2026-09-13 15:28:18 -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 7bb457f948 Formatting fixes. 2026-09-12 15:54:44 -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 9590852a29 Fix drag and drop pieces into inline edit models. 2026-07-22 22:56:57 -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 f12794e9e0 Fixed ui scale on retina displays. 2026-03-07 16:11:38 -08: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 ce206cffe8 Simplified selection history by storing the states instead of changes. 2026-01-31 13:38:25 -08:00
Leonardo Zide 96bc1dc700 Added remaining selection actions. 2026-01-12 14:42:09 -08:00
Leonardo Zide 8342e147cf Added RemoveFromSelection action. 2026-01-10 21:34:21 -08:00
Leonardo Zide a018b166c5 Added action for ClearSelectionAndSetFocus. 2026-01-10 20:06:16 -08:00
Leonardo Zide f69166cf3d Undo some selection actions. 2026-01-10 11:00:39 -08:00
Leonardo Zide 4e49d4d0cc Fixed warnings. 2025-12-18 16:18:45 -03:00
Leonardo Zide a08dede88b Fixed warnings. 2025-12-15 11:07:35 -03:00
Leonardo Zide 910c3de13e Added zoom region action. 2025-12-08 21:08:48 -08:00
Leonardo Zide 561cf9cf52 Added camera action. 2025-12-06 16:21:33 -08:00
Leonardo Zide 3bf01f2095 Added actions for mouse drag changes. 2025-11-23 20:33:59 -08:00
Leonardo Zide 35c8652405 Support dragging the paint tool. 2025-08-09 12:35:32 -07:00
Leonardo Zide 2e507036d9 Refactored part picker popups. 2025-07-08 19:31:27 -07:00