Fix T69364: GPencil Array Modifiers causes crash
This bug was introduced when adding the support for default materials.
This commit is contained in:
parent
883706395e
commit
ae43b1d51b
Notes:
blender-bot
2023-02-14 02:22:07 +01:00
Referenced by issue #69364, GPencil: Array Modifiers causes crash
|
@ -88,7 +88,7 @@ bool is_stroke_affected_by_modifier(Object *ob,
|
|||
bool inv3,
|
||||
bool inv4)
|
||||
{
|
||||
Material *ma = give_current_material(ob, gps->mat_nr + 1);
|
||||
Material *ma = BKE_material_gpencil_get(ob, gps->mat_nr + 1);
|
||||
MaterialGPencilStyle *gp_style = ma->gp_style;
|
||||
|
||||
/* omit if filter by layer */
|
||||
|
|
|
@ -119,7 +119,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData
|
|||
for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
|
||||
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
|
||||
|
||||
Material *mat = give_current_material(ob, gps->mat_nr + 1);
|
||||
Material *mat = BKE_material_gpencil_get(ob, gps->mat_nr + 1);
|
||||
if (mat == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData
|
|||
for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
|
||||
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
|
||||
|
||||
Material *mat = give_current_material(ob, gps->mat_nr + 1);
|
||||
Material *mat = BKE_material_gpencil_get(ob, gps->mat_nr + 1);
|
||||
if (mat == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData
|
|||
for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
|
||||
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
|
||||
|
||||
Material *mat = give_current_material(ob, gps->mat_nr + 1);
|
||||
Material *mat = BKE_material_gpencil_get(ob, gps->mat_nr + 1);
|
||||
if (mat == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue