Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_paint.c
| Show First 20 Lines • Show All 1,238 Lines • ▼ Show 20 Lines | else { | ||||
| if (depth_arr) { | if (depth_arr) { | ||||
| MEM_freeN(depth_arr); | MEM_freeN(depth_arr); | ||||
| } | } | ||||
| } | } | ||||
| /* Save material index */ | /* Save material index */ | ||||
| gps->mat_nr = BKE_gpencil_object_material_get_index_from_brush(p->ob, p->brush); | gps->mat_nr = BKE_gpencil_object_material_get_index_from_brush(p->ob, p->brush); | ||||
| if (gps->mat_nr < 0) { | |||||
| if (p->ob->actcol - 1 < 0) { | |||||
| gps->mat_nr = 0; | |||||
| } | |||||
| else { | |||||
| gps->mat_nr = p->ob->actcol - 1; | |||||
| } | |||||
| } | |||||
| /* calculate UVs along the stroke */ | /* calculate UVs along the stroke */ | ||||
| ED_gpencil_calc_stroke_uv(obact, gps); | ED_gpencil_calc_stroke_uv(obact, gps); | ||||
| /* add stroke to frame, usually on tail of the listbase, but if on back is enabled the stroke | /* add stroke to frame, usually on tail of the listbase, but if on back is enabled the stroke | ||||
| * is added on listbase head because the drawing order is inverse and the head stroke is the | * is added on listbase head because the drawing order is inverse and the head stroke is the | ||||
| * first to draw. This is very useful for artist when drawing the background. | * first to draw. This is very useful for artist when drawing the background. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 2,657 Lines • Show Last 20 Lines | |||||