Move createMaterial to MaterialManagementModel and simplify it a bit

We can reuse our duplicateMaterial function again but in a simpler way. Also finding the preferred material is simpler with our container tree.
However there seems to be a problem with finding the preferred material; it's not finding generic_pla for UM3 and AA0.4 anyway, and then falls back on a random material. This needs to be fixed in the variant node class.

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-27 17:08:56 +02:00
parent cb344f9dec
commit 3952366798
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
2 changed files with 37 additions and 2 deletions

View file

@ -122,7 +122,7 @@ Item
onClicked:
{
forceActiveFocus();
base.newRootMaterialIdToSwitchTo = base.materialManager.createMaterial();
base.newRootMaterialIdToSwitchTo = base.materialManagementModel.createMaterial();
base.toActivateNewMaterial = true;
}
}