GP: Reduce updates of material previews
If there is a update in progress, don't update again.
This commit is contained in:
parent
353e691ff9
commit
20b30b6bee
Notes:
blender-bot
2023-02-14 08:29:54 +01:00
Referenced by issue #56455, [2.8] Crash when projecting skinwrap curve/path
|
@ -1 +1 @@
|
|||
Subproject commit 1a5f14657ee06ec2f520326032305dc1f2c5e2d5
|
||||
Subproject commit 371960484a38fc64e0a2635170a41a0d8ab2f6bd
|
|
@ -1 +1 @@
|
|||
Subproject commit b4496a81e4f3d607a692f7c2e12fce3dbd784de4
|
||||
Subproject commit 15b25a42783d1e516b5298d70b582fae2559ae17
|
|
@ -115,9 +115,20 @@ static void rna_MaterialGpencil_update(Main *bmain, Scene *scene, PointerRNA *pt
|
|||
|
||||
/* update previews (icon and thumbnail) */
|
||||
if (preview != NULL) {
|
||||
preview->flag[ICON_SIZE_ICON] |= PRV_CHANGED;
|
||||
preview->flag[ICON_SIZE_PREVIEW] |= PRV_CHANGED;
|
||||
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_PREVIEW, ma);
|
||||
bool changed = false;
|
||||
if ((preview->flag[ICON_SIZE_ICON] & PRV_CHANGED) == 0) {
|
||||
preview->flag[ICON_SIZE_ICON] |= PRV_CHANGED;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if ((preview->flag[ICON_SIZE_PREVIEW] & PRV_CHANGED) == 0) {
|
||||
preview->flag[ICON_SIZE_PREVIEW] |= PRV_CHANGED;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_PREVIEW, ma);
|
||||
}
|
||||
}
|
||||
WM_main_add_notifier(NC_GPENCIL | ND_DATA, ma);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue