Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_add_monkey.c
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
| /* Add color an ensure duplications (matched by name) */ | /* Add color an ensure duplications (matched by name) */ | ||||
| static int gpencil_monkey_color( | static int gpencil_monkey_color( | ||||
| Main *bmain, Object *ob, const ColorTemplate *pct, bool stroke, bool fill) | Main *bmain, Object *ob, const ColorTemplate *pct, bool stroke, 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 882 Lines • Show Last 20 Lines | |||||