mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
Ported a couple more methods to XS
This commit is contained in:
parent
ed75219215
commit
3a9cf91f83
8 changed files with 33 additions and 27 deletions
|
@ -824,6 +824,24 @@ Print::has_support_material() const
|
|||
return false;
|
||||
}
|
||||
|
||||
/* This method assigns extruders to the volumes having a material
|
||||
but not having extruders set in the volume config. */
|
||||
void
|
||||
Print::auto_assign_extruders(ModelObject* model_object) const
|
||||
{
|
||||
// only assign extruders if object has more than one volume
|
||||
if (model_object->volumes.size() < 2) return;
|
||||
|
||||
size_t extruders = this->config.nozzle_diameter.values.size();
|
||||
for (ModelVolumePtrs::const_iterator v = model_object->volumes.begin(); v != model_object->volumes.end(); ++v) {
|
||||
if (!(*v)->material_id().empty()) {
|
||||
size_t extruder_id = (v - model_object->volumes.begin()) + 1;
|
||||
if (!(*v)->config.has("extruder"))
|
||||
(*v)->config.opt<ConfigOptionInt>("extruder", true)->value = extruder_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
REGISTER_CLASS(Print, "Print");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue