Commit Graph
369 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 688859b120 Localize numeric displays and HTML export labels
Format UI measurements, snap angles, ladder increments, edge-color values, Preferences labels, counts, and step/page labels using the widget locale without grouping. Preserve numeric table sorting with stored count values and trim localized zero digits correctly. Give float/double formatting and float parsing explicit helper names.

Mark HTML export titles, navigation, alternate text, and credits for translation, escape translated text, and declare UTF-8 output. Keep numbers in HTML, piece-list images, and print/PDF output in ASCII. Include the pending command-status translation drafts in all eight language catalogs, preserving their unfinished review status.

Validation: macOS Qt debug build, display and count-sorting checks across ten locales, all three HTML layouts with test translations under an Arabic numeric locale, and ASCII print/image checks. All eight catalogs pass XML, changed-placeholder, and lrelease validation.
2026-10-23 14:17:52 -07:00
Leonardo Zide 5c1126519d Reject invalid Array and transform input with optional results
Rename the localized float parser to lcParseFloatValueLocalized and return std::optional<float> so conversion failures and nonfinite values cannot silently become zero. Return std::optional<lcVector3> from GetTransformAmount and apply transforms only when every nonempty axis is valid, preserving blank axes as zero.

Validate all Array offsets and rotations before updating dialog results, and show an informational message with focus on invalid input. Verified with a macOS Qt debug build and actual Array/transform checks in US English, German, and Arabic locales, including blank input, overflow, NaN, and infinity.
2026-10-23 13:04:18 -07:00
Leonardo Zide 513e556ce9 Standardize model terminology and command descriptions
Use model and submodel terminology in user-facing help, errors, and the Windows file-type description. Standardize keyframe and spotlight text across menus, properties, undo history, and default light names while preserving internal identifiers and file-format tokens.

Correct the directional-light and movement-snapping descriptions, remove obsolete Ctrl advice from Zoom Extents, and fix deselection and rotation wording. Leave translation catalogs unchanged for the deferred catalog update.

Validation: debug build passes without warnings; UI XML and string-only diff checks pass.
2026-10-22 22:08:53 -07:00
Leonardo Zide 7829c6f5fe Add contextual help to docks and toolbars
Provide contextual descriptions and F1 access for the five docks and main toolbars, including accessible property labels and keyframe controls. Handle chooser shortcuts across popup boundaries so help follows the focused control.

Register What's This as a customizable command in the Help menu and centralize command descriptions in lcCommand for translation during action creation. Refresh catalogs while preserving existing translations and review status.
2026-10-22 21:28:16 -07:00
Leonardo Zide 5f3bfbf9fa Use consistent message severities and simplify ordinary dialogs
Show recoverable rendering, export, library, and network failures as warnings.
Default Blender messages to Warning, keep renderer startup failures Critical,
and remove the duplicate Blender installation failure dialog.

Replace 28 ordinary Blender helper calls with QMessageBox statics while
retaining specialized dialogs with informative text, details, or update
preferences. Preserve confirmation buttons and defaults and suppress static
startup/export messages without a main window. Rename the failed-result
helper to ShowResultError and refresh catalog locations and retired strings.

Validation: Qt 6.10 debug build; catalog coverage for all 2,056 active messages
and existing translation preservation; git diff --check.
2026-10-22 12:29:30 -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 b2463083f1 Standardize UI capitalization and punctuation
Use consistent capitalization for labels, dialog titles, acronyms, and
product names. Correct question-mark spacing, sentence boundaries, missing
punctuation, and run-together sentences in prompts and Blender messages.

Refresh the language catalogs without discarding existing translations.
Retain previous source text and mark affected translations unfinished so
translators can review the wording changes while drafts remain visible.

Validation: Qt 6.10 debug build, catalog source coverage and preservation
checks, runtime translation and plural checks, and git diff --check.
2026-10-22 12:05:23 -07:00
Leonardo Zide bcb6545464 Fix runtime localization and refresh translation catalogs
Translate Blender defaults after translators are installed and give the
spinner its own translation context. Translate remaining page and minifigure
labels, and use Qt numerus messages for count-dependent text. Embed an English
plural catalog so missing locale translations still have correct singular
and plural forms.

Refresh all eight language catalogs and fill missing translations as
unfinished drafts with provenance comments. Preserve existing translation
text, placeholders, markup, internal identifiers, and combo/filter syntax.
Keep nonempty unfinished translations visible in release catalogs.

Validation: Qt 6.10 debug build; warning-free lupdate extraction; active
catalog keys match all 2,044 source messages; catalog integrity checks;
runtime checks of spinner and 228 Blender default strings plus 472 plural,
draft visibility, placeholder, and English fallback cases.
2026-10-22 11:34:56 -07:00
Leonardo Zide 66d98fd3a7 Standardize piece terminology and English UI strings
UI labels mixed part and piece terminology, several messages left asset and file names unquoted, and Blender preferences contained British spellings and typos.

Use piece terminology throughout displayed text, quote names and paths in messages and tooltips, and standardize US English spelling. Keep status-bar names and the properties-dialog title unquoted. Update translation source keys while preserving existing translations, settings keys, and external format names.

Validation: macOS Qt 6.10 Debug build passed without warnings; XML, translation-key, placeholder, and whitespace checks passed.
2026-10-22 10:49:59 -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 137c645ce6 Remove obsolete library cleanup and capability APIs
UnloadUnusedParts selects identities with zero references and calls the release
path, which immediately returns without changing them. Remove the no-op scan
and its model, project and preview callers, including the now-unused LoadLDD
library local. Actual last-reference unload and temporary identity cleanup remain
in their existing lifetime paths.

SupportsStudStyle always returns true. Remove the method and the unreachable
preferences branch that disables the stud-style selector.

Validation: warning-free macOS Qt 6.10 Debug build, all 45 offscreen lifecycle
checks and diff whitespace checks pass. No remaining references to either API.
2026-10-19 20:41:18 -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 74e16b0d13 Enable shadow warnings for non-MSVC builds
Enable -Wshadow to bring GCC and Clang shadowing diagnostics closer to the MSVC warning configuration. Rename the filename extension variable to avoid shadowing the file type extension, and remove the unused synthesized-piece failure counter.

Validated with a macOS debug rebuild with no warnings or errors.
2026-10-17 13:41:41 -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 476ebc06bf Separate main panel and popup parts display preferences
Changing parts display options in a popup previously overwrote the settings
used by the main Pieces panel. Store icon size, list mode, part names,
decorated pieces, and aliases separately for the main panel and for all
popups, while retaining shared search preferences.

Initialize popup context before loading preferences. Keep color locking
exclusive to the main panel so popups use the color supplied by their
caller, and hide color locking and palette editing in popup menus.

Popup preferences begin with their own defaults.

Validation: the Qt 6.10 debug build passes.
2026-10-11 22:12:32 -07:00
Leonardo Zide 75dc3883da Store profile enums as stable strings and harden settings reads
Persist enum preferences through named typed accessors using stable PascalCase tokens. Keep explicit legacy integer mappings so existing settings continue to load when enum members are reordered, and fall back to declared defaults for invalid values.

Validate scalar conversions and reject non-finite floats while preserving unsigned color bits returned by signed native settings backends. Read fixed part colors as unsigned values and remove their override when unlocking so the unlocked state survives restart.

Save both view-sphere enabled flags directly, preserving disabled spheres even when their remembered sizes are nonzero.

Validation: macOS application build and temporary enum and persistence regression checks passed. Windows and Linux execution was not performed.
2026-10-10 23:32:40 -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 6d8f778e3d Show malformed model warnings in the status tooltip
Duplicate MPD definitions and circular model references were skipped silently, leaving files such as the examples in issue #533 empty without an explanation.

Record load warnings and display them alongside asset failures in the existing status icon tooltip. Collect warnings from nested external projects, deduplicate repeated references, and preserve source filenames across successful merges. Reset diagnostics when loading another document.

Validated both issue examples, nested and repeated references, merge warning preservation and deduplication, failed merges, and clean reloads. The macOS debug build and diff checks pass.

Fixes #533
2026-10-08 23:01:52 -07:00
Leonardo Zide f39e1ae70a Support embedded LDraw texture data
Parse !DATA blocks as project-scoped assets and resolve TEXMAP textures
from immutable asset snapshots without sharing same-named embedded images
between external projects. Preserve original document blocks when saving,
including blank lines, payload formatting, and unchanged model text.

Carry required submodels and embedded assets through copy, paste, and
exports, validating conflicts before import. Return clipboard errors to
the main window and preserve selected objects when Cut cannot copy them.

Fixes #937
2026-10-08 21:49:14 -07:00
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 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 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 941dd38724 Update loading tooltip. 2026-10-01 10:25:59 -07:00
Leonardo Zide a719139d47 Replace asset loading progress bar with animated spinner 2026-09-30 10:15:44 -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 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 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 499984b9aa Persist view menu display settings 2026-09-19 20:57:07 -07:00
Leonardo Zide 7bb457f948 Formatting fixes. 2026-09-12 15:54:44 -07:00
Leonardo Zide c84019dbc3 Replace multiple bool params with flags. 2026-09-07 18:44:14 -07:00
Leonardo Zide 56eeee9266 Modernize profile functions.
• Replace legacy union/char* profile storage with std::variant<int,uint,float,QString,QStringList,QByteArray> and QString for section/key; remove LC_PROFILE_ENTRY_TYPE/mType.
• Update getters/setters to use std::get_if defaults; add lcProfileInit() and fix a "Settgins" typo.
• Convert color profile accessors to unsigned (lcGet/SetProfileUInt) where appropriate.
• Add LC_PROFILE_PARTS_LIST_COLOR_LOCKED and migrate PartsList color logic (preserves legacy -1 behavior).
2026-08-30 17:22:28 -07:00
Leonardo Zide 0361c61ab1 More result cleanup. 2026-07-31 22:53:25 -07:00
Leonardo Zide 9dbe3695b7 Add new lcResult class to handle task failures more cleanly. 2026-07-29 22:48:12 -07:00
Leonardo Zide 2439e6f72e Fix MMB not closing model tabs. 2026-07-22 17:19:28 -07:00
Leonardo Zide 2574114ae4 Update recent menu when it's shown. 2026-07-22 16:10:13 -07:00
Leonardo Zide 60c4a674c6 Support merging multiple files at once. Fixes #1007. 2026-05-20 16:54:03 -07:00
Leonardo Zide 64b829b074 Convert SLOT macros to function pointers. 2026-05-03 15:32:17 -07:00
Leonardo Zide 1ea54149c5 Refactor set inventory parsing. 2026-05-03 15:30:11 -07:00
Leonardo Zide 80ea68245c Move Select Dialog. 2026-05-02 16:06:27 -07:00
Leonardo Zide 664429f635 Move Image Dialog files. 2026-05-02 15:51:08 -07:00
Leonardo Zide e4b829b7e2 Reorganize Save Image dialog. 2026-05-02 15:44:48 -07:00