From 298e6921a7040ae3fbe66d1acbd1dc7f5d26aa4d Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Mon, 25 Nov 2024 17:43:56 +0100 Subject: [PATCH] Draft: fix color of arrays If `get_diffuse_color` returned a list with a single color, the list was wrongly multiplied. Regression introduced in V0.21, but in that version the error was masked by how Core handled the diffuse color. Fixes #17052. --- src/Mod/Draft/draftviewproviders/view_array.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/draftviewproviders/view_array.py b/src/Mod/Draft/draftviewproviders/view_array.py index b6b1b9acb6..0a3a1810d8 100644 --- a/src/Mod/Draft/draftviewproviders/view_array.py +++ b/src/Mod/Draft/draftviewproviders/view_array.py @@ -56,7 +56,9 @@ class ViewProviderDraftArray(ViewProviderDraft): obj = vobj.Object if obj.Base is not None: colors = gui_utils.get_diffuse_color(obj.Base) - if colors: + if not colors: + return + if len(colors) > 1: n = 1 if hasattr(obj, "ArrayType"): if obj.ArrayType == "ortho": @@ -68,7 +70,7 @@ class ViewProviderDraftArray(ViewProviderDraft): elif hasattr(obj, "Count"): n = obj.Count colors = colors * n - vobj.DiffuseColor = colors + vobj.DiffuseColor = colors # Alias for compatibility with v0.18 and earlier