mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix Grease Pencil materials added by Python missing
These materials were missing from the "Change Active Material" menu. Caused by rBe3faef686d38. Error was getting the preview [which wasnt there yet] These only appeared once the material tab in the Properties Editor was used (since this ensured a valid preview icon). Above commit changed behavior for RNA icon getter (this does not create data anymore), so ensure the preview by hand here. Similar to rB182edd4c35c2. Fixes T102566. Maniphest Tasks: T102566 Differential Revision: https://developer.blender.org/D16541
This commit is contained in:
parent
6008c67859
commit
4d58a1c657
1 changed files with 1 additions and 0 deletions
|
|
@ -296,6 +296,7 @@ class GPENCIL_MT_material_active(Menu):
|
|||
|
||||
for slot in ob.material_slots:
|
||||
mat = slot.material
|
||||
mat.id_data.preview_ensure()
|
||||
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…
Add table
Add a link
Reference in a new issue