Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_edit.c
| Show First 20 Lines • Show All 349 Lines • ▼ Show 20 Lines | static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op) | ||||
| } | } | ||||
| if (mode == OB_MODE_PAINT_GPENCIL) { | if (mode == OB_MODE_PAINT_GPENCIL) { | ||||
| /* be sure we have brushes */ | /* be sure we have brushes */ | ||||
| BKE_paint_ensure(ts, (Paint **)&ts->gp_paint); | BKE_paint_ensure(ts, (Paint **)&ts->gp_paint); | ||||
| Paint *paint = &ts->gp_paint->paint; | Paint *paint = &ts->gp_paint->paint; | ||||
| /* if not exist, create a new one */ | /* if not exist, create a new one */ | ||||
| if ((paint->brush == NULL) || (paint->brush->gpencil_settings == NULL)) { | if ((paint->brush == NULL) || (paint->brush->gpencil_settings == NULL)) { | ||||
| BKE_brush_gpencil_presets(C); | BKE_brush_gpencil_presets(bmain, ts); | ||||
| } | } | ||||
| BKE_paint_toolslots_brush_validate(bmain, &ts->gp_paint->paint); | BKE_paint_toolslots_brush_validate(bmain, &ts->gp_paint->paint); | ||||
| } | } | ||||
| /* setup other modes */ | /* setup other modes */ | ||||
| ED_gpencil_setup_modes(C, gpd, mode); | ED_gpencil_setup_modes(C, gpd, mode); | ||||
| /* set cache as dirty */ | /* set cache as dirty */ | ||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | ||||
| ▲ Show 20 Lines • Show All 4,328 Lines • Show Last 20 Lines | |||||