Fixed "setting an extruder does not change object's color"

This commit is contained in:
bubnikv 2018-11-22 13:20:13 +01:00
parent 94b1183843
commit a4be8ef6ad
4 changed files with 30 additions and 17 deletions
src/libslic3r

View file

@ -1232,6 +1232,19 @@ void ModelVolume::set_material(t_model_material_id material_id, const ModelMater
this->object->get_model()->add_material(material_id, material);
}
// Extract the current extruder ID based on this ModelVolume's config and the parent ModelObject's config.
int ModelVolume::extruder_id() const
{
int extruder_id = -1;
if (this->is_model_part()) {
const ConfigOption *opt = this->config.option("extruder");
if (opt == nullptr)
opt = this->object->config.option("extruder");
extruder_id = (opt == nullptr) ? 0 : opt->getInt();
}
return extruder_id;
}
#if ENABLE_MODELVOLUME_TRANSFORM
void ModelVolume::center_geometry()
{