Get name of both the G-code and project file from the 1st printable
object's name or file path. Fixed some compilation warnings.
This commit is contained in:
parent
405d18a7fa
commit
3b973e01dd
4 changed files with 14 additions and 18 deletions
src/libslic3r
|
@ -549,11 +549,18 @@ void Model::reset_auto_extruder_id()
|
|||
|
||||
std::string Model::propose_export_file_name() const
|
||||
{
|
||||
std::string input_file;
|
||||
for (const ModelObject *model_object : this->objects)
|
||||
for (ModelInstance *model_instance : model_object->instances)
|
||||
if (model_instance->is_printable())
|
||||
return model_object->name.empty() ? model_object->input_file : model_object->name;
|
||||
return std::string();
|
||||
if (model_instance->is_printable()) {
|
||||
input_file = model_object->name.empty() ? model_object->input_file : model_object->name;
|
||||
if (! input_file.empty())
|
||||
goto end;
|
||||
// Other instances will produce the same name, skip them.
|
||||
break;
|
||||
}
|
||||
end:
|
||||
return input_file;
|
||||
}
|
||||
|
||||
ModelObject::~ModelObject()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue