Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_add_stroke.c
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| } ColorTemplate; | } ColorTemplate; | ||||
| /* Add color an ensure duplications (matched by name) */ | /* Add color an ensure duplications (matched by name) */ | ||||
| static int gp_stroke_material(Main *bmain, Object *ob, const ColorTemplate *pct, const bool fill) | static int gp_stroke_material(Main *bmain, Object *ob, const ColorTemplate *pct, const bool fill) | ||||
| { | { | ||||
| short *totcol = give_totcolp(ob); | short *totcol = give_totcolp(ob); | ||||
| Material *ma = NULL; | Material *ma = NULL; | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (STREQ(ma->id.name, pct->name)) { | if (STREQ(ma->id.name, pct->name)) { | ||||
| return i; | return i; | ||||
| } | } | ||||
| } | } | ||||
| int idx; | int idx; | ||||
| /* create a new one */ | /* create a new one */ | ||||
| ▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines | |||||