[Bf-blender-cvs] [cfc6eb73913] blender-v3.2-release: Fix T99178: Console warning using search (F3) in grease pencil draw mode

Antonio Vazquez noreply at git.blender.org
Mon Jun 27 11:44:02 CEST 2022


Commit: cfc6eb739138eb02ea882b8360afda60774923e8
Author: Antonio Vazquez
Date:   Mon Jun 27 09:13:29 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBcfc6eb739138eb02ea882b8360afda60774923e8

Fix T99178: Console warning using search (F3) in grease pencil draw mode

The preview data was not available in this context and need to be checked to avoid the warning.

===================================================================

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 9864bb3336f..df6d43ffb0f 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -303,7 +303,7 @@ class GPENCIL_MT_material_active(Menu):
 
         for slot in ob.material_slots:
             mat = slot.material
-            if mat:
+            if mat and mat.id_data and mat.id_data.preview:
                 icon = mat.id_data.preview.icon_id
                 layout.operator("gpencil.material_set", text=mat.name, icon_value=icon).slot = mat.name



More information about the Bf-blender-cvs mailing list