Adding the defaultExtruderPosition could be wrongly adding an unused extruder. In this case I do prefer a try/except to indicate that this is kind of an edge-case, and it also avoids some string/int conversions.
Co-authored-by: Erwan MATHIEU <erwan.mathieu@ultimaker.com>
When the painted model goes from a machine with higher number of extruders to a lower number of extruders with painted data, adding the same safeguard as the limit to extruder settings to prevent crash
... because the extruders used for the current object can change (clear all bits of extruder #2 paint on a single object, which results in the object printed with extruder #1 only, which could result in the prime-tower needing to be gone -- or the other way around).
The _previous_ way of doing that was just spamming the stack changes, but that gave other problems.
part of CURA-12752
CURA-12752
The previous method was not efficient enough in case of large models, where a single painting stroke can easily cover almost the whole texture (in bounding box). Reverted to the version where the whole texture is counted, but cached in the SliceableObjectDecorator and updated on timer so that it is not done during painting.
Rewrite the whole 'count pixels to get extruders for paint on materials' so that it's cached outside of the extruder manager instead, so that counting pixels in a 4096x4096 image isn't called xx of times per second.
part of CURA-12752
The whitelist of the preferences only allows: "general/visible_settings", "cura/active_mode", "cura/categories_expanded", "metadata/setting_version" to be stored.
In backups, we're obfuscating Secret Preferences and these should be considered as items for that.
(Not sure I'm happy with this, but) now we can use this _both_ in the slicing itself _and_ the bounds. The big downsides are a) I had to connect the scene changed signal to the on-stack-changed method, that seems ugly and potentially slow b) I'm not sure this method belongs in the ExtruderManager -- otoh, where else is it going to live (unless we want to make a new type of plugin-object?).
CURA-12752
New rules means we have to put printjobs and such behind a little authentication, as these contain personally identifiable info. These two effected calls where found _outside_ of the API class where I thought to be able to fix it 100%. See also the TODO's in the neighbourhood -- but I'm not sure I can just do what those say (move the relevant methods to the API), as those methods to be moved are _inside_ the larger Cura SDK (and they're public) and the place where I'm meant to move them to (the ClusterAPIClient) is _not_ (as they're in a plugin).
part of CURA-12624
CURA-12660
This required a refactoring of the management of the active view. The previous behavior was that anyone could set the active view, depending on certain conditions. But now we also have a view that is set by a tool, so sometimes the actually set view would be incorrect. Now each Stage requests an active view, and each tool CAN also request an active view. Then the Controller decides which view should actually be active depending on the active stage and tool.
CURA-12660
When a message box is displayed, some offscreen rendering passes (face selection) render an unpredictable result and we are unable to start painting.
This went through a refactoring of the rendering passes. Since doing the offscreen rendering outside the Qt rendering loop caused some troubles, we now use the rendering passes only inside the Qt rendering loop, so that they work properly. Tools also have the ability to indicate which extra passes they require, so that we don't run all the passes when they are not required.
Since this issue also concerns the support blockers placement and rotation by face selection, they have been updated so that they now also always work.
The face selection mechanism using the Selection class was partially working and used only by the rotation, so now it has been deprecated in favor of the new mechanism.
This caused issues where the code deleted in this ticket was almost the same as in Uranium, except it was slightly buggy (but it also did slightly more, hence the new 'on_done' parametrer).
part of CURA-12630
CURA-12016
Add a method to load instances of GlobalStack instead of loading all the ContainerStack and then filtering them. This makes the code more explicit and saves some time.