CURA-4482
UM2 by default doesn't have variants, but if the user enables Olsson
Block, the variant option will become available. This commit fixes the
following cases:
- Make sure that the variant is set on the extruder stack but not the
global stack
- Extruder stacks don't contain information such as has_variant. Such
info should be retrieved from the global stack and not just from the
definition container because they can be overriden by other
containers.
Not all extruder stacks have a next stack. Well currently every extruder stack should have a next stack, but the code is built around the possibility that there isn't a next stack elsewhere too.
Contributes to issue CURA-4121.
We do not load the extruders in a fixed order, thus we cannot assume
that addExtruder is called in the right order. This means that index 0
of the extruders is not necessarily the extruder with position 0. So
instead, use the extruder position as a dict key.
Contributes to CURA-3738
This is to ensure that Global stacks are loaded before extruders, so once the extruders are deseralized, they can always find the next (global) stack
CURA-3497