Fix of an invalid extruder ID assignment after switching from
a multi-material printer to a single material printer (or a printer with a lower number of extruders).
This commit is contained in:
parent
440fbb1e74
commit
6572e5980f
1 changed files with 7 additions and 3 deletions
|
@ -455,10 +455,14 @@ void Model::adjust_min_z()
|
||||||
unsigned int Model::get_auto_extruder_id(unsigned int max_extruders)
|
unsigned int Model::get_auto_extruder_id(unsigned int max_extruders)
|
||||||
{
|
{
|
||||||
unsigned int id = s_auto_extruder_id;
|
unsigned int id = s_auto_extruder_id;
|
||||||
|
if (id > max_extruders) {
|
||||||
if (++s_auto_extruder_id > max_extruders)
|
// The current counter is invalid, likely due to switching the printer profiles
|
||||||
|
// to a profile with a lower number of extruders.
|
||||||
reset_auto_extruder_id();
|
reset_auto_extruder_id();
|
||||||
|
id = s_auto_extruder_id;
|
||||||
|
} else if (++s_auto_extruder_id > max_extruders) {
|
||||||
|
reset_auto_extruder_id();
|
||||||
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue