mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 19:58:59 +08:00
Fix providing of global_inherits_stack settings
I've rewritten this part and documented what each case catches. There is a base case which is not required any more since we removed the global tab, but I left it in for defense. Contributes to issue CURA-2006.
This commit is contained in:
parent
eaa7d716f5
commit
1c1bfbe114
@ -94,21 +94,29 @@ ScrollView
|
|||||||
{
|
{
|
||||||
target: provider
|
target: provider
|
||||||
property: "containerStackId"
|
property: "containerStackId"
|
||||||
when: model.settable_per_extruder || (inheritStackProvider.properties.global_inherits_stack == -1 || inheritStackProvider.properties.global_inherits_stack == null)
|
when: {
|
||||||
|
var now = model.settable_per_extruder || model.settable_per_mesh || (inheritStackProvider.properties.global_inherits_stack == null && inheritStackProvider.properties.global_inherits_stack < 0);
|
||||||
|
return now;
|
||||||
|
}
|
||||||
value:
|
value:
|
||||||
{
|
{
|
||||||
if(inheritStackProvider.properties.global_inherits_stack == -1 || inheritStackProvider.properties.global_inherits_stack == null)
|
if(!model.settable_per_extruder && !model.settable_per_mesh)
|
||||||
{
|
{
|
||||||
|
//Not settable per extruder, so we must pick global.
|
||||||
|
return Cura.MachineManager.activeMachineId;
|
||||||
|
}
|
||||||
|
if(inheritStackProvider.properties.global_inherits_stack != null && inheritStackProvider.properties.global_inherits_stack >= 0)
|
||||||
|
{
|
||||||
|
//We have global_inherits_stack, so pick that stack.
|
||||||
|
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.global_inherits_stack)];
|
||||||
|
}
|
||||||
if(ExtruderManager.activeExtruderStackId)
|
if(ExtruderManager.activeExtruderStackId)
|
||||||
{
|
{
|
||||||
return ExtruderManager.activeExtruderStackId
|
//We're on an extruder tab. Pick the current extruder.
|
||||||
|
return ExtruderManager.activeExtruderStackId;
|
||||||
}
|
}
|
||||||
else
|
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
|
||||||
{
|
return Cura.MachineManager.activeMachineId;
|
||||||
return Cura.MachineManager.activeMachineId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.global_inherits_stack)]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user