Commit Graph
100 Commits
Author SHA1 Message Date
Leonardo Zide 7e9283fec0 Monitor only the active project file
Watching referenced and inactive projects can produce reload prompts outside the current document. Register watches only when a project becomes active, and retain content baselines so unchanged writes and application saves stay quiet.

Debounce file and directory events, retry transient read failures, and restore monitoring after replacement or deletion and recreation. Validate reload ownership around the dialog and scope candidate projects so failed reloads release their resources. Check read errors before clearing existing model data.
2026-10-08 10:12:14 -07:00
Leonardo Zide b3c325dbc3 Suppress file change prompts for unchanged contents
Filesystem watcher events can be triggered by metadata updates or identical rewrites, so forwarding every event directly to the reload dialog produces false notifications.

Track a content hash after loading, saving, and observing external edits. Only prompt for different readable contents, ignore stale and duplicate events, and restore the file watch after atomic replacement even when the contents are unchanged.

Validation: macOS debug build and native Qt watcher checks covering timestamp updates, identical replacements, same-size edits, repeated changes, own-save baselines, stale events, and empty files.
2026-10-07 09:49:25 -07:00
Leonardo Zide 8197a28517 Carry explicit meshes for direct export geometry
Direct geometry in root and nested models was collected with a null mesh override, despite the documented export contract. Exporters recovered the mesh through PieceInfo, which also selected the shared-part path in POV-Ray.

Supply the direct model mesh explicitly and document the borrowed mesh override semantics. This aligns collection with the contract while preserving catalog fallback and generated instance meshes.

Validation: Debug build, 33 targeted collection/export checks covering OBJ, COLLADA, 3DS and POV-Ray/LGEO, and git diff --check passed.
2026-10-05 14:24:34 -07:00
Leonardo Zide cd6cf53c7b Propagate parts-list rendering failures with lcResult
A null framebuffer readback was treated as empty geometry, so a parts
list could retain a blank entry or silently omit it after rendering failed.
The QImage return type also conflated an empty inventory with an error.

Return lcResult<QImage> and abort on failed thumbnail readback after
framebuffer and renderer cleanup. Report framebuffer creation and image
allocation failures explicitly while preserving successful empty inventory
and unavailable-geometry behavior. HTML export propagates the error text;
the instructions UI clears its stale image and displays a warning parented
to the scene's view.

Validation: full debug build and whitespace checks passed. A temporary
OpenGL fault-injection harness covered first and later readback failures
with both missing-parts policies, framebuffer creation failure, successful
empty results, and restoration of caller context, surface, and framebuffer
bindings. The warning dialog was not exercised interactively.
2026-10-05 14:18:57 -07:00
Leonardo Zide a152d3442c Restore caller GL state after output rendering
Step-image and parts-list helpers switched to the shared offscreen context
and left it current after rendering. Framebuffer release and destruction
also replaced a caller's existing binding with the default framebuffer.
This violated the output helpers' state-restoration contract on both
success and failure.

Capture the caller's context, surface, and framebuffer bindings in a scope
guard before asset waits and rendering. Restore them after the temporary
view is destroyed, preserving separate draw/read bindings where supported
and leaving no context current when the caller started without one.

Validation: full debug build and whitespace checks passed. A temporary
OpenGL regression harness verified step-image and parts-list success and
framebuffer creation failure with an alternate caller context, an alternate
surface on the shared context, nondefault framebuffer bindings, and no
initially current context.
2026-10-05 14:01:41 -07:00
Leonardo Zide 62a84dff86 Update AGENTS.md 2026-10-05 13:55:22 -07:00
Leonardo Zide 265b543f64 Detect include cycles and cancel blocked primitive loads
External projects were loaded before their identities were registered,
allowing mutually referencing files to recurse until stack exhaustion.
Track canonical paths during nested loads and reject repeated paths
with a failed-piece error.

Primitive dependencies could wait indefinitely on themselves or form
cycles across workers. Track active dependency edges, reject cycles,
and replace polling with cancellation-aware condition waits. Signal
cancellation during queue drains and restore its previous state afterward.

Validation: full debug build and whitespace checks passed. A temporary
regression harness covered external and primitive cycles, 100 concurrent
cyclic-load attempts, cancellation, completion, cache hits, and queue
shutdown.
2026-10-05 13:54:50 -07:00
Leonardo Zide 45de08aaae Propagate framebuffer tile readback failures before copying pixels 2026-10-05 13:33:16 -07:00
Leonardo Zide 1e9b0df568 Fix reference counting for shared thumbnail cache hits 2026-10-05 13:31:21 -07:00
Leonardo Zide e780f4a30a Settle assets before insertion and dragging 2026-10-05 12:47:30 -07:00
Leonardo Zide 145b3238db Document asset loading contracts and clarify queue helper naming 2026-10-04 19:29:33 -07:00
Leonardo Zide 622774f254 Simplify streaming asset priorities to promotion only
Keep each pending mesh and texture request at its highest requested priority
until it completes or is cancelled. Use one promotion helper for visible
requests and synchronous waits, propagating promotions to pending textures
without lowering priorities required by shared work.

Remove outgoing-project demotion and restoration during file opening and
LDD import. Existing reference counts continue to cancel unused queued work
and preserve assets shared with the incoming project or other views.

Validation: macOS Debug build, git diff --check, 16 priority/cancellation
checks, and 199 bounds, external-project undo, and output regression checks.
2026-10-04 17:19:28 -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 dcd2ef5a3b Defer synth notifications and reject missing mesh includes 2026-10-04 12:37:17 -07:00
Leonardo Zide 586bba300f Include root direct geometry in camera fitting 2026-10-04 12:21:14 -07:00
Leonardo Zide 1753a185c8 Fix OBJ face syntax and COLLADA source counts 2026-10-04 11:37:19 -07:00
Leonardo Zide a861557c38 Replace placeholder piece type with failed asset state 2026-10-04 11:32:47 -07:00
Leonardo Zide 1f012285f1 Fix textured mesh collada export. 2026-10-01 19:19:27 -07:00
Leonardo Zide f772eeaa92 Fix exporting meshes with textures to obj. 2026-10-01 19:09:28 -07:00
Leonardo Zide 7b746acccf Increase arrow hover visibility. 2026-10-01 14:19:30 -07:00
Leonardo Zide 4d82380a41 Fix warning. 2026-10-01 12:15:04 -07:00
Leonardo Zide 941dd38724 Update loading tooltip. 2026-10-01 10:25:59 -07:00
Leonardo Zide 129e56f704 Fix mip generation OOB on odd sized textures. 2026-10-01 10:04:44 -07:00
Leonardo Zide c791447cdb Merge pull request #1037 from schodet/fix-appdata
Fix AppStream metadata
2026-09-30 15:28:27 -07:00
Leonardo Zide a719139d47 Replace asset loading progress bar with animated spinner 2026-09-30 10:15:44 -07:00
Leonardo Zide 6c8184b03c Merge pull request #1038 from schodet/fix-typo
Fix spelling typo
2026-09-30 08:55:37 -07:00
Leonardo Zide f4d00bf41d Fix Fade Previous Step affecting thumbnails. Fixes #1035. 2026-09-29 23:27:10 -07:00
Leonardo Zide 11bbd2a103 Guard asset readiness and buffer cleanup without renderer state
Skip container bounds publication for temporary models without a PieceInfo. Avoid accessing the GL context when releasing an empty shared buffer set while preserving dirty-state tracking.
2026-09-29 23:17:55 -07:00
Leonardo Zide 7e9384ed41 Sanitize export names and fix LGEO slope output
Keep COLLADA and POV-Ray identifiers close to source names while resolving collisions and maintaining consistent references.

Encode HTML filenames safely, escape display text, and use stable model ordinals. Preserve LGEO slope mappings and apply slope materials and bump normals correctly.
2026-09-29 19:00:09 -07:00
Leonardo Zide f87ee484eb Include direct model geometry in 3D exports 2026-09-29 09:22:56 -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 50d4e15c53 Add missing include. 2026-09-28 10:54:24 -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 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 9fd8d50179 Harden asset cache and mesh loading paths
Validate cache I/O and zlib results, reject incomplete mesh allocations, and keep shared buffer offsets safe when rebuilding. Document loader priorities and repository editing conventions.
2026-09-26 11:10:02 -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 29c9c98402 Introduce asset loader boundary for streaming groundwork
Move part scheduling and futures into a library-owned lcAssetLoader while preserving current loading behavior. Hold queued parts alive through completion, deliver completion notifications on the UI thread, and drain work before library teardown.

Pause queued work during stud-style changes, rebuild affected meshes, and use an unambiguous mesh-cache settings key. Guard mesh-buffer rebuilding against allocation failure.

Add the loader to the qmake build and document common build conventions.
2026-09-24 18:56:48 -07:00
Leonardo Zide 2c3a5a5a4e Fix TEXMAP NEXT and included-file state
Consume NEXT after the next geometry line, keep each included file’s TEXMAP entries scoped to that file, and propagate nested load failures. Reset failed primitive state and partial mesh data before retries.
2026-09-23 22:19:31 -07:00
Leonardo Zide 3b11dcc6a2 Resolve project texture filenames without case sensitivity 2026-09-23 12:28:02 -07:00
Leonardo Zide 3e437bcb7d Manage temporary project texture references 2026-09-23 11:57:17 -07:00
Leonardo Zide 3e376ddb84 Release mesh texture references on destruction 2026-09-23 11:09:15 -07:00
Leonardo Zide 197a3d18e6 Validate mesh geometry records before use
Skip incomplete type 1-5 records instead of processing uninitialized coordinates or filenames. Bound type-1 filename parsing to its destination buffer.
2026-09-22 22:58:36 -07:00
Leonardo Zide cec7e8a79f Remove conditional-line index data
Pack conditional vertices by color and material in high/shared/low order so each LOD draws with one non-indexed call per section. Calculate bounds from direct vertex ranges, support meshes without index data, and rename the section draw fields.

Fix conditional vertex remapping in included primitives and bump the mesh cache version to rebuild stale data.

Fixes #644
2026-09-22 22:46:01 -07:00
Leonardo Zide 57332f834e Improve move gizmo feedback 2026-09-21 22:34:18 -07:00
Leonardo Zide 499984b9aa Persist view menu display settings 2026-09-19 20:57:07 -07:00
Leonardo Zide 6228ae4313 Add release checklist 2026-09-19 17:44:46 -07:00
Leonardo Zide 61b30d0a42 Finalize release library links 2026-09-19 17:28:49 -07:00
Leonardo Zide 5196355d4a Build release packages from tags 2026-09-19 16:44:29 -07:00
Leonardo Zide 94f32bd0ed Update appveyor.yml 2026-09-19 11:16:39 -07:00
Leonardo Zide c6c27d62a0 Fix possible int overflow. 2026-09-19 10:01:40 -07:00
Leonardo Zide b7a90f3ea9 Merge branch 'master' of https://github.com/leozide/leocad 2026-09-19 09:59:02 -07:00
Leonardo Zide ae7a89aed5 Fix warnings. 2026-09-18 18:23:32 -07:00
Leonardo Zide 4059c474de Update release version to 26.09 2026-09-18 16:43:20 -07:00
Leonardo Zide d56a1f2d62 Update release library references 2026-09-18 16:36:24 -07:00
Leonardo Zide c460568b7a Cap part selection popup size 2026-09-18 16:21:24 -07:00
Leonardo Zide 462fea9d4c Update minifig wizard settings 2026-09-18 15:44:13 -07:00
Leonardo Zide 687733d79a Fix tiled part thumbnails with MSAA
Fixes #842
2026-09-17 11:38:43 -07:00
Leonardo Zide 404c8981f8 Use Qt context for texture deletion 2026-09-17 10:31:36 -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 87397c3aaa Refresh preview label after undo 2026-09-15 22:41:27 -07:00
Leonardo Zide ea0d5ccc6f Track saved history by revision
Replace the saved history entry pointer with monotonic revision IDs so branching after undo cannot leave a dangling marker or accidentally reuse an address. Preserve selection-only history behavior and prevent merges from modifying the saved revision.
2026-09-14 16:17:12 -07:00
Leonardo Zide 7c35fc608f Preserve history across submodel renames
Remap renamed submodel IDs in pending, undo, and redo snapshots so restoring an older edit continues to resolve the live submodel. Update the renamed model's property snapshots as well while preserving saved-history entry identity.
2026-09-14 16:01:13 -07:00
Leonardo Zide f7e76e2744 Scope history merging to edit context
Include the current step, Add Keys mode, and property edit ID in the history merge key so repeated edits do not coalesce across timeline contexts. Replace the packed property ID representation with an explicit typed field and separate mergeable history creation from ordinary edits.
2026-09-14 15:19:22 -07:00
Leonardo Zide 91e244ca7a Enable single-entry undo after model switch 2026-09-14 09:30:45 -07:00
Leonardo Zide 9cc000a56c Keep project modified state after undo 2026-09-14 09:27:51 -07:00
Leonardo Zide 9961910a8f Refresh parts in use after undo 2026-09-14 09:17:20 -07:00
Leonardo Zide 209875489d Optimize history state restoration 2026-09-14 09:04:35 -07:00
Leonardo Zide 0d8c8d344a Fix piece references during history restore 2026-09-13 21:49:43 -07:00
Leonardo Zide b8e3f16f3a Prevent merging edits across save boundary 2026-09-13 21:46:44 -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 6e30e75c8d Fix rotation ring rendering at silhouette 2026-09-13 21:36:46 -07:00
Leonardo Zide 704dfce07c Compile fix. 2026-09-13 17:50:05 -07:00
Leonardo Zide 5b1716350f Fix undo for setting piece show step 2026-09-13 16:43:33 -07:00
Leonardo Zide 276e96141a Disable command line image export on iOS 2026-09-13 16:38:58 -07:00
Leonardo Zide b74bebc1db Stop Blender render when step export fails 2026-09-13 16:34:59 -07:00
Leonardo Zide 83d129997a Fix OpenGL widget event forwarding 2026-09-13 16:31:31 -07:00
Leonardo Zide dbee3fcb14 Fix undo for removing piece from group 2026-09-13 16:21:28 -07:00
Leonardo Zide 26801763a9 Fix canceling float property edits 2026-09-13 16:15:37 -07:00
Leonardo Zide bcb572fc61 Split rotation gizmo drawing helpers 2026-09-13 15:56:17 -07:00
Leonardo Zide 36e373997c Refactor rotation gizmo drawing 2026-09-13 15:47:36 -07:00
Leonardo Zide 4ddeab6a0b Draw trackball hover indicator. 2026-09-13 15:28:18 -07:00
Leonardo Zide f5ace52543 Update rotate gizmo style. 2026-09-13 15:04: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 222befff0d Tighten matrix rotation similarity tolerance 2026-09-12 20:31:54 -07:00
Leonardo Zide ac81d13a19 Compile fix. 2026-09-12 16:18:33 -07:00
Leonardo Zide 7bb457f948 Formatting fixes. 2026-09-12 15:54:44 -07:00
Leonardo Zide 949f91f878 Build universal macOS app in AppVeyor 2026-09-12 13:45:39 -07:00
Leonardo Zide d08fae0558 Finalize completed POV-Ray renders after final frame 2026-09-12 13:43:18 -07:00
Leonardo Zide a8dee1732e Download POV-Ray binaries from the build1 release tag. 2026-09-12 13:39:38 -07:00
Leonardo Zide f1802487da Build macos arm64. 2026-09-08 21:39:07 -07:00
Leonardo Zide 6083bbcc82 Draw start/current rotation direction. 2026-09-07 22:14:39 -07:00
Leonardo Zide 51423fdc22 Fix duplicate vcredist. Fixes #950. 2026-09-07 19:01:28 -07:00
Leonardo Zide c84019dbc3 Replace multiple bool params with flags. 2026-09-07 18:44:14 -07:00
Leonardo Zide 29e06089a3 Change rotate x/y/z to match camera rotate. 2026-09-07 18:07:54 -07:00
Leonardo Zide c053582941 Rotation gizmo polish. 2026-09-06 12:32:59 -07:00
Leonardo Zide c76e03338f Remove dead RotateXY. 2026-09-06 11:08:25 -07:00