Restore material on global stack when switching back to single extrusion

MachineManager._onGlobalContainerChanged removes the global material of multiextruder machines
This commit is contained in:
fieldOfView 2017-04-11 12:18:33 +02:00
parent 31ecb30c03
commit f15345a0cb

View File

@ -370,6 +370,13 @@ Cura.MachineAction
return; return;
} }
var extruder_material;
if(index == 0 && Cura.MachineManager.hasMaterials)
{
// setting back to single extrusion
extruder_material = Cura.MachineManager.allActiveMaterialIds[Cura.MachineManager.activeStackId];
}
machineExtruderCountProvider.setPropertyValue("value", index + 1); machineExtruderCountProvider.setPropertyValue("value", index + 1);
manager.forceUpdate(); manager.forceUpdate();
base.extruderTabsCount = (index > 0) ? index + 1 : 0; base.extruderTabsCount = (index > 0) ? index + 1 : 0;
@ -389,6 +396,12 @@ Cura.MachineAction
{ {
ExtruderManager.setActiveExtruderIndex(-1); ExtruderManager.setActiveExtruderIndex(-1);
} }
if(extruder_material)
{
// restore material on global stack
// MachineManager._onGlobalContainerChanged removes the global material of multiextruder machines
Cura.MachineManager.setActiveMaterial(extruder_material);
}
} }
} }
} }