Fix T69364: GPencil Array Modifiers causes crash

This bug was introduced when adding the support for default materials.
This commit is contained in:
Antonio Vazquez 2019-09-01 09:31:20 +02:00
parent 883706395e
commit ae43b1d51b
Notes: blender-bot 2023-02-14 02:22:07 +01:00
Referenced by issue #69364, GPencil: Array Modifiers causes crash
4 changed files with 4 additions and 4 deletions

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}