Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_paint.c
| Show First 20 Lines • Show All 2,007 Lines • ▼ Show 20 Lines | if ((brush->gpencil_settings) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* initialize a drawing brush */ | /* initialize a drawing brush */ | ||||
| static void gp_init_drawing_brush(bContext *C, tGPsdata *p) | static void gp_init_drawing_brush(bContext *C, tGPsdata *p) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | |||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = CTX_data_tool_settings(C); | ToolSettings *ts = CTX_data_tool_settings(C); | ||||
| Paint *paint = &ts->gp_paint->paint; | Paint *paint = &ts->gp_paint->paint; | ||||
| bool changed = false; | bool changed = false; | ||||
| /* 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)) { | ||||
| /* create new brushes */ | /* create new brushes */ | ||||
| BKE_brush_gpencil_presets(C); | BKE_brush_gpencil_presets(bmain, ts); | ||||
| changed = true; | changed = true; | ||||
| } | } | ||||
| /* be sure curves are initializated */ | /* be sure curves are initializated */ | ||||
| BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_sensitivity); | BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_sensitivity); | ||||
| BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_strength); | BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_strength); | ||||
| BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_jitter); | BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_jitter); | ||||
| /* assign to temp tGPsdata */ | /* assign to temp tGPsdata */ | ||||
| ▲ Show 20 Lines • Show All 2,158 Lines • Show Last 20 Lines | |||||