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

"Reload from disk" - UI function overhaul #4388

Merged
merged 14 commits into from
Apr 23, 2018
Merged

Conversation

Oekn5w
Copy link
Contributor

@Oekn5w Oekn5w commented Apr 19, 2018

Related issue: #4374

Description

The function now tries to reload all referenced files (original object and added parts and modifiers) and asks the user how to proceed.
In the issue some opinions were given, that the function should discard all manual configurations (as 3mf files already contain them), and some that it should keep them (working with multiple exported STLs).

Additionally, warnings are thrown, if the reload doesn't work (original file deleted, object cut/ split) or added parts/ modifiers loose their reference to the path (modifier file deleted, less volumes in file -> the mesh is copied in that case).

Changes breakdown by file

Plater.pm
function load_file: pass the correct object index
set variables in the volumes to determine their origin
function reload_from_disk: see description

ObjectPartsPanel.pm
set variables in the volumes to determine their origin (parts/ modifiers)

Model.xsp/.hpp/.cpp
adding needed variables to ModelVolume

Testing

Testing turned out to be tedious, as the names had to be changed repeatedly, but I think I covered all relevant cases (major mesh change, different number of volumes, application of configurations)
The attached files were used.
Multidomain_test_files.zip

@lordofhyphens
Copy link
Member

Looks good+clean from a source perspective; I will build and take a look at the UI before merging.

@lordofhyphens
Copy link
Member

image
test_reload.zip

Disable auto-center parts (x,y).

Load 20mmbox.stl, and then add 20mmbox_2z.stl. You'll see it goes off into the corner (may be a bug, idk). Move it back.

Click OK and try to reload. The modifier mesh gets kicked off into the ether again. :(

@lordofhyphens
Copy link
Member

Also, a "do this all the time and don't bother me again" checkbox would be a good idea (with the ability to set/unset it from File->Preferences), I think.

@Oekn5w
Copy link
Contributor Author

Oekn5w commented Apr 20, 2018

Load 20mmbox.stl, and then add 20mmbox_2z.stl. You'll see it goes off into the corner (may be a bug, idk). Move it back.

Not a bug, the mesh of 2Z is way of center
grafik

The modifier mesh gets kicked off into the ether again. :(

Well, it reloads the source again, and scaling and translation in the parts panel are directly applied to the mesh without history, no way of fixing this for now. (Full transformation matrices and quaternion rotation in a future milestone?)
I didn't want to create a new window for that pop up only, but it seems to be the best option, especially since in a separat window a new option can be added to copy the modifier meshes without reloading them.

I also thought about a don't ask me again. The preference panel seems to be kept pretty clean on purpose, but that might be the best option, as the issue showed different workflows regarding reloading.

…d default option in preferences, copied volumes are matched the new object's origin translation
@lordofhyphens lordofhyphens merged commit 72db339 into slic3r:master Apr 23, 2018
@gege2b
Copy link
Contributor

gege2b commented Apr 24, 2018

just tested and seems to work as expected

I think it's a good compromise that should make everyone happy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants