Ultimaker / Uranium

A Python framework for building Desktop applications.
GNU Lesser General Public License v3.0
326 stars 185 forks source link

Reloading a 3mf file that has additional models in it #899

Open pietchaki opened 1 year ago

pietchaki commented 1 year ago

tl;dr : want to add a new object node from UM.Scene._reloadJobFinished().

Recently I've been using 3mf files for my projects for its ability to hold multiple models into a single file. I had some issues with how Cura handles the objects and made some improvements to fix them, namely https://github.com/Ultimaker/Uranium/pull/898 and https://github.com/Ultimaker/Cura/pull/16610 With those improvements I can easily identify multiple models inside the file, and if I change one of the models I can easily reload the file to update their mesh.

Current problem is when I add a new model to a file that is already loaded into Cura, it will update the existing ones but not load the new one. The "File has been modified" message is handled by Uranium, and I want this method to add a new object node to the scene. My problem is that most of the methods needed for that are only available in the "Cura" portion of the project, and I couldn't find how to call functions there, and copying all that into Uranium seems wrong. I'd like help to find the better way to make it work.