Instead of selecting first, return only uniques.

part of CURA-6917
This commit is contained in:
Remco Burema 2019-11-07 17:19:18 +01:00
parent 6e79f489e2
commit 3636eed964
No known key found for this signature in database
GPG key ID: 215C49431D43F98C
2 changed files with 3 additions and 3 deletions

View file

@ -341,9 +341,9 @@ class ContainerManager(QObject):
def getLinkedMaterials(self, material_node: "MaterialNode", exclude_self: bool = False) -> List[str]:
same_guid = ContainerRegistry.getInstance().findInstanceContainersMetadata(GUID = material_node.guid)
if exclude_self:
return [metadata["name"] for metadata in same_guid if metadata["base_file"] != material_node.base_file]
return list({meta["name"] for meta in same_guid if meta["base_file"] != material_node.base_file})
else:
return [metadata["name"] for metadata in same_guid]
return list({meta["name"] for meta in same_guid})
## Unlink a material from all other materials by creating a new GUID
# \param material_id \type{str} the id of the material to create a new GUID for.

View file

@ -46,7 +46,7 @@ TabView
{
return ""
}
return linkedMaterials[0];
return linkedMaterials;
}
function getApproximateDiameter(diameter)