mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Prevent writing empty materials to AMF files. Also add a note about material-id = 0 being reserved by AMF spec. #2871
This commit is contained in:
parent
e26022a2f2
commit
fbea32a81c
2 changed files with 4 additions and 1 deletions
|
@ -690,7 +690,8 @@ ModelVolume::assign_unique_material()
|
|||
{
|
||||
Model* model = this->get_object()->get_model();
|
||||
|
||||
this->_material_id = 1 + model->materials.size();
|
||||
// as material-id "0" is reserved by the AMF spec we start from 1
|
||||
this->_material_id = 1 + model->materials.size(); // watchout for implicit cast
|
||||
return model->add_material(this->_material_id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue