Commit graph

366 commits

Author SHA1 Message Date
HellAholic
b564d2005e Defer 3MF node loading until machine activation
Postpone reading/adding 3MF scene nodes until after the target machine/UCP is activated to ensure correct build volume and settings are applied. Adds a deferred filename field and stores the file during initial load, then reads and adds nodes in new _loadAndAddNodesToScene using AddSceneNodeOperation after activation. Fixes _updateActiveMachine calls to use the reader's is_ucp state, resets is_ucp only after nodes are added, and clears the deferred filename in _clearState. Also updates WorkspaceDialog and QML logic so machine selection/combobox visibility behave correctly for UCP files.
2026-03-02 15:40:01 +01:00
HellAholic
8cc504d765 code-review comments part II
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
Add type hints to ThreeMFWorkspaceReader methods
2026-02-23 12:36:40 +01:00
HellAholic
590e98b41b code-review comments part I 2026-02-23 12:28:58 +01:00
HellAholic
a0e3911922
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-21 14:36:32 +01:00
HellAholic
aefe8333c6 Refactor logging to use specific Logger methods
Replace generic Logger.log(...) calls with explicit Logger.error/warning/info/debug methods and standardize message formatting using f-strings. Also update Logger.logException call formatting for clarity. This is a stylistic refactor to make log severities and messages consistent across ThreeMFWorkspaceReader.py with no behavioral changes intended.
2026-02-21 14:26:25 +01:00
HellAholic
ab1cedd919 Defer machine activation and material apply
Delay active-machine switching and postpone applying materials/user settings until after machine activation so container/metadata signals can propagate. Removed the immediate _updateActiveMachine/_applyMaterials calls and replaced them with deferred callbacks using Application.getInstance().callLater: _finalizeMachineActivation -> _applyMaterialsAndFinalize for non-UCP flows, and _finalizeUcpActivation -> _applyUcpUserSettings for UCP flows. Adjusted _updateActiveMachine signature to accept is_ucp and moved containersChanged.emit to the deferred finalizers to ensure re-validation occurs after all changes are applied.
2026-02-21 13:36:06 +01:00
Erwan MATHIEU
d64c3629eb Fix possible crash when loading a 3MF file
CURA-12872
2026-02-13 08:54:48 +01:00
Remco Burema
44cfdb935f Quality groups names are case-sensitive, so don't lower-case search.
This caused some settings not to load silently, since it has a fall-back to default.

CURA-12112
2024-10-16 10:27:21 +02:00
c.lamboo
600f5cdaf6 Fix opening empty ucp files
CURA-11703
2024-03-29 16:23:38 +01:00
HellAholic
29c3c2f098
Merge pull request #18756 from Ultimaker/CURA-11703_fix_ucp_jump_coords
[CURA-11703] Reset entire scene around center for UCP.
2024-03-29 11:36:45 +01:00
Casper Lamboo
4c9b74edff
Remove unintuitive comment 2024-03-29 10:38:27 +01:00
Remco Burema
0d585f367f Reset entire scene around center for UCP.
Since we can't rely on the build-volume --because we can't know on which printer we open-- the safest bet (and the thing alowed by 3mf if I recall) is to just center the entire scene on the buildplate for Universal Cura Project files.

CURA-11703
2024-03-28 23:51:35 +01:00
Remco Burema
93861073d3 Fix another open-file resulting in a crash.
If the materials doesn't have the right key in it, just continue. It should be somewhere after all.

part of CURA-11772
2024-03-28 17:00:57 +01:00
Remco Burema
bc5532dab3 Prevent crash if the variants only have an 'empty' entry.
Just get the one you'd get if no variant was asked (like in the other branch of the if) then.

CURA-11772
2024-03-26 14:01:35 +01:00
Saumya Jain
e90cbcfa01 not clearing the current machinein case of UCP
because we don't want to write again the same thing.
CURA-11701
2024-03-13 13:38:46 +01:00
Saumya Jain
831a1d4876 Reset openAsUcp at the start of preread
CURA-11403
2024-03-06 12:32:05 +01:00
Saumya Jain
8ef7b65710 removing update existing/ create new in case of UCP
also, making sure post processing scripts are not loaded.

CURA-11403
2024-03-05 16:37:17 +01:00
Saumya Jain
c879809836 selected printer is active printer in UCP
CURA-11403
2024-03-04 16:47:09 +01:00
Saumya Jain
b1b9660651 removing select same profile checkbox
CURA-11403
2024-03-01 15:43:37 +01:00
Saumya Jain
f67d2ed5fe Remove setting visibility for Ucp
show settings expanded by default

CURA-11403
2024-03-01 15:25:24 +01:00
Saumya Jain
f3c49e494e adding option of opening model as UCP or normal project file
CURA-11403
2024-02-29 15:45:13 +01:00
c.lamboo
62aff0be12 Determine ucp based on included file
CURA-11403
2024-02-21 11:40:51 +01:00
Saumya Jain
ec871782c7 PAP adding save dialog before filesave window
CURA-11403
2024-02-20 10:47:27 +01:00
saumya.jain
b641741e49 Added preference to show UFP saving dialog
Changes saving to .ucp to .3mf
2024-02-16 14:11:07 +01:00
Erwan MATHIEU
345ddc40bb Fix file opening failure
CURA-11561
2024-02-09 11:54:49 +01:00
Erwan MATHIEU
93cb358599 Add FIXMEs where big changes are required
CURA-11561
2024-02-09 07:43:48 +01:00
Erwan MATHIEU
63c1eb8990 Rename to Universal Cura Project
CURA-11561
2024-02-05 14:15:43 +01:00
Erwan MATHIEU
2ae9908334 Fix crash
CURA-11561
2024-02-05 12:58:02 +01:00
Erwan MATHIEU
9afe5b46db We now display the global and extruder settings in the dialog
CURA-11561
2024-02-05 12:39:56 +01:00
Erwan MATHIEU
2d79479a26 Avoid displaying the discard changed dialog
CURA-11561
2024-02-02 16:17:27 +01:00
Erwan MATHIEU
ab0a52063d Now loading user settings
CURA-11561
2024-02-02 16:05:36 +01:00
Erwan MATHIEU
733ef4d3d8 UI now displays an option to select the same profile
CURA-11561
2024-02-02 12:17:34 +01:00
saumya.jain
b5c47ae8f3 Intent type translated while reading 3mf
CURA-11221
2023-11-07 10:54:59 +01:00
c.lamboo
fa1f5a7c89 Boyscouting
CURA-11189
2023-10-20 15:10:39 +02:00
saumya.jain
f3829c3ebe comments fix and clean code
CURA-18869
2023-09-15 10:56:48 +02:00
saumya.jain
43fddcf012 Opening the value of setting only if they are not in missing packages
CURA-10915
2023-09-11 13:37:08 +02:00
c.lamboo
b19b229752 Boyscouting
CURA-10406
2023-03-17 17:02:42 +01:00
Jaime van Kessel
14ec6560e4
Fix lookup for upgraded intents
CURA-10406
2023-03-17 16:20:11 +01:00
Jaime van Kessel
884ec911e7
Convert to new style type hint annotation
Boyscouting

CURA-10406
2023-03-15 10:30:27 +01:00
Jaime van Kessel
336906deb5
Add missing typing to the container info objects
Boyscouting

CURA-10406
2023-03-15 10:28:13 +01:00
Jaime van Kessel
6a9f1f519d
Don't upgrade during pre-read
This doesn't seem to be needed and it breaks when profiles have been
renamed.

CURA-10406
2023-03-15 10:23:31 +01:00
jspijker
ea1a6d1a6e capitalize M
Contribute to CURA-10208
2023-03-07 07:57:59 +01:00
Joey de l'Arago
1d1800e440 Remove print statements
CURA-9424
2022-11-17 17:03:05 +01:00
Joey de l'Arago
dd510a5dfc Cleanup
CURA-9424
2022-11-17 16:58:16 +01:00
Joey de l'Arago
4d2f6b9655 Previously there would always be one item in the updateableMachinesModel ("Create new"). This was moved to a button instead of being part of the model.
This fixes new machines being incorrectly created when a machine already exists.

CURA-9424
2022-11-17 16:21:57 +01:00
Joey de l'Arago
156004cb17 Move logic for deciding the initially selected printer that was inside WorkspaceDialog.qml before into WorkspaceDialog.py.
A block of code is run after dialog.show() and most of the dialog assignment. This is because dialog.show() resets the _result dictionary, we want to update the values in _result afterwards.

CURA-9424
2022-11-16 16:11:19 +01:00
c.lamboo
dc65e801d0 Set machine isAbractMachine in workspace dialog initialisation 2022-11-15 15:35:16 +01:00
Joey de l'Arago
28862c89e5 Show online badge and printer icon when initially loading machine selector
CURA-9424
2022-11-15 15:03:23 +01:00
Joey de l'Arago
959c42d96a The printer to override was not being set initially, causing file loading to fail when not selecting a printer in the MachineSelector.
Fix is to set it on initialization from the WorkspaceReader

CURA-9424
2022-11-14 13:34:46 +01:00
Joey de l'Arago
8e56631972 3mf project files saved with an abstract printer would crash on loading when selecting a non abstract printer to load the project with.
This was because the metadata "is_abstract_machine" was being loaded into the non abstract machine. This caused a crash in MachineListModel.py by trying to delete this non abstract machine from a list where it didn't exist.

The solution is to ignore the "is_abstract_machine" metadata when loading settings from saved machines in 3mf files.

CURA-9711
2022-10-05 15:27:39 +02:00