diff --git a/cura/Settings/MaterialsModel.py b/cura/Settings/MaterialsModel.py index bab8929765..e3d56c2f86 100644 --- a/cura/Settings/MaterialsModel.py +++ b/cura/Settings/MaterialsModel.py @@ -1,6 +1,7 @@ # Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from typing import Any, List from UM.Settings.ContainerRegistry import ContainerRegistry #To listen for changes to the materials. from UM.Settings.Models.InstanceContainersModel import InstanceContainersModel #We're extending this class. @@ -23,3 +24,10 @@ class MaterialsModel(InstanceContainersModel): def _onContainerChanged(self, container): if container.getMetaDataEntry("type", "") == "material": super()._onContainerChanged(container) + + ## Group brand together + def _sortKey(self, item) -> List[Any]: + result = [] + result.append(item["metadata"]["brand"]) + result.extend(super()._sortKey(item)) + return result