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.
This commit is contained in:
parent
49fd02de61
commit
cfc6eb7391
Notes:
blender-bot
2023-02-14 04:10:15 +01:00
Referenced by issue #99178, Error when executing menu search (F3) in grease pencil draw mode Referenced by issue #98661, 3.2: Potential candidates for corrective releases
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue