Commit Graph
196 Commits
Author SHA1 Message Date
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 851eecee50 Store only changed objects in edit undo history
Full before-and-after model snapshots accumulate large amounts of memory during editing, even when an operation changes only one object. Compact completed edits to retain only added, removed, or modified object states, with ordering metadata kept only for structural changes.

Restore objects by stable IDs, including group relationships, and detach views before removing cameras. Compose merged edits from their deltas and compare animation keys as well as current property values so keyframe-only edits remain undoable.
2026-10-21 10:48:24 -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 f4fe4f8e87 Clarify asset loader request and completion APIs
Use consistent names for piece loading, synth generation, worker completions, and outstanding work. Remove the unused library drain wrapper and call the loader directly during settings updates.

Check for the final consumer release in the library before cancelling queued piece work, and document how running builds retain their load hold until completion. Update callers and asset-loading documentation.
2026-10-15 13:35:34 -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 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 669467d305 Restore external project references when undoing deletion 2026-10-04 14:05:54 -07:00
Leonardo Zide 8ceceb95ba Allow outputs with missing geometry and fit available meshes 2026-10-04 13:57:35 -07:00
Leonardo Zide a861557c38 Replace placeholder piece type with failed asset state 2026-10-04 11:32:47 -07:00
Leonardo Zide b242cf9ad5 Generate synth meshes asynchronously
Queue per-piece synth builds alongside mesh and texture work, with cooperative cancellation for obsolete requests. Keep the previous mesh visible during edits and account for generated meshes in blocking output and loading progress. Defer preview and thumbnail rendering until their required synth meshes settle.
2026-09-28 22:49:16 -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 1d02dde890 Scope project pieces and preserve assets across model changes
Keep project-local piece mappings separate from library pieces and preserve references across rename, merge, delete, and Save As.

Remap local external pieces after Save As, retain texture source order, invalidate stale loads, and refresh previews and thumbnails after asset changes. Save projects atomically and preserve active model selection in the model list.
2026-09-28 09:22:09 -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 a79d4953e3 Implement staged mesh and texture loading
Build meshes and decode textures in workers, then publish meshes and upload textures on the UI thread. Mark a part loaded only after its textures are ready.

Add request cancellation, priorities, and waits scoped to required assets. Keep previews and thumbnails from rendering incomplete parts, preserve failure diagnostics, and handle corrupt caches and project changes.
2026-09-25 16:58:29 -07:00
Leonardo Zide 0d8c8d344a Fix piece references during history restore 2026-09-13 21:49:43 -07:00
Leonardo Zide a8e37df8ce Whitespace cleanup. 2026-03-10 21:11:40 -07:00
Leonardo Zide 9e1b8e0032 Fixed typos. 2026-03-10 19:55:49 -07:00
Leonardo Zide bc9bc3a1b2 Removed unused code. 2026-03-07 18:01:11 -08:00
Leonardo Zide ce0d7c7be3 Removed group action. 2026-02-14 12:34:29 -08:00
Leonardo Zide fb71e545a9 Saved undo data as structures. 2026-02-11 20:15:26 -08:00
Leonardo Zide c8dca012f9 Replaced bool Ortho with lcCameraProjection::Orthographic for clarity. 2026-02-03 21:46:00 -08:00
Leonardo Zide c627e1608e Merged selection/focus code in the lcObject class. 2026-01-25 23:01:47 -08:00
Leonardo Zide 6334c159a9 Removed add piece action. 2025-12-28 15:21:09 -03:00
Leonardo Zide 49308948d1 Removed duplicate piece action. 2025-12-26 16:50:46 -03:00
Leonardo Zide 8dfa1772b3 Fixed control point undo. 2025-12-26 11:53:51 -03:00
Leonardo Zide 2741b86e9c Don't save selection in object edit actions. 2025-12-21 13:39:34 -03:00
Leonardo Zide c2db2d8d45 Added bounds check to strcat. 2025-12-15 11:19:23 -03:00
Leonardo Zide 4de6c095e4 Save the entire object state to the undo buffer instead of only key frames. 2025-12-04 17:41:04 -08:00
Leonardo Zide 3bf01f2095 Added actions for mouse drag changes. 2025-11-23 20:33:59 -08:00
Leonardo Zide 6df16f5742 Added step insert and delete actions. 2025-11-19 22:34:53 -08:00
Leonardo Zide bf8e4cb8fa Merged Blender point/spot radius into a single setting. 2025-08-31 10:41:07 -07:00
Leonardo Zide 35f9c8e8e5 Removed float* operator from math classes. 2025-05-18 11:10:32 -07:00
Leonardo Zide 6a26e60f55 Made vector to float cast explicit, and fixed unintended casts. 2025-05-17 20:23:33 -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 6ab237f50a Whitespace fixes. 2024-12-19 15:54:40 -08:00
Leonardo Zide 4f2782b407 Added rotate train track gizmo. 2024-12-17 19:20:38 -08:00
Leonardo Zide 24b7c43a09 Fixed train track gizmo drawing when a rotated connection has focus. 2024-12-09 10:42:31 -08:00
Leonardo Zide fd61c1c9f9 Added gizmo to rotate train tracks. 2024-11-30 12:29:15 -08:00
Leonardo Zide a08ad3f81b Detect train track connections and pick an open one when inserting. 2024-11-27 13:04:53 -08:00
Leonardo Zide 14e5e7d126 Connect train tracks when inserting with the keyboard. 2024-11-23 18:03:54 -08:00
Leonardo Zide 80d144fea8 Array cleanup. 2024-05-26 13:01:34 -07:00
Leonardo Zide aae75b36fe Removed lcArray from control points. 2024-05-12 12:45:15 -07:00
Leonardo Zide 14d1217850 Replaced property specific functions with the generic function. 2024-04-14 11:08:30 -07:00
Leonardo Zide 3528817d22 Split light size into different variables per type. 2024-04-07 12:48:41 -07:00
Leonardo Zide 5d5274b2b4 Split light power into different properties for Blender and POV-Ray. 2024-04-07 11:28:54 -07:00
Leonardo Zide 69ae4ea492 Added POV-Ray prefix to spot tightness and area grid 2024-04-06 18:50:37 -07:00