Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor object reload to handle 3mf files #898

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

pietchaki
Copy link
Contributor

@pietchaki pietchaki commented Aug 29, 2023

Description

When a 3MF file that has multiple models inside is loaded, Cura will alert if the file has been modified and asks if the user wants to reload id. When that happen, all objects from that file where being replaced by the first model in the file.
Another minor issue was that when reloading, Cura would read the same file multiple times, one for each model.

! Important: This PR Requires Ultimaker/Cura#16610

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Confirmed other filetypes where not affected by the refactor:

  • Opened a OBJ file and reloaded.

  • Opened STL file and reloaded.

  • Opened gcode file, and reloaded.

  • Loaded a 3MF file with multiple models into Cura, verified the name of the models in the app are the model name in the file.

  • Updated the 3MF file changing the mesh for the models but keeping the names. Clicked the message asking to reload the file and confirmed meshes are updated.

  • Updated the 3MF file removing one of the models, clicked the message asking to reload and confirmed it works as before and keep the mesh in the scene.

  • Updated the 3MF file, adding a new mesh into it, clicked the message asking to reload and confirmed it works as before and the new mesh is NOT loaded in the scene{1}.

{1}: This should be an improvement, as the newly added model should be loaded when we reload a file. However I couldn't find a simple way to do that at the moment and will try to fix it in a later improvement.

Test Configuration:

  • Operating System: Windows 10

Checklist:

Refactor object reload to better handling of 3mf files

Make a single file read for all objects from that file, and then
replace the objects in scene to the new ones, matching by name.

This Require Update to the CuraApplication that currently rename
all objects with the file name.

3mf Files can have multiple objects in them. When that is the case,
and the file is updated, all objects from that file where being
replaced by the first object in the file.
@github-actions github-actions bot added the PR: Community Contribution 👑 Community Contribution PR's label Aug 29, 2023
@saumyaj3 saumyaj3 self-assigned this Oct 11, 2023
@saumyaj3 saumyaj3 marked this pull request as draft October 11, 2023 12:00
@pietchaki pietchaki marked this pull request as ready for review October 13, 2023 02:42
@saumyaj3 saumyaj3 merged commit d6a63ca into Ultimaker:main Nov 1, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Community Contribution 👑 Community Contribution PR's
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants