Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_utils.c
| Show First 20 Lines • Show All 1,385 Lines • ▼ Show 20 Lines | void ED_gpencil_add_defaults(bContext *C, Object *ob) | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| ToolSettings *ts = CTX_data_tool_settings(C); | ToolSettings *ts = CTX_data_tool_settings(C); | ||||
| 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)) { | ||||
| /* create new brushes */ | /* create new brushes */ | ||||
| BKE_brush_gpencil_presets(C); | BKE_brush_gpencil_presets(bmain, ts); | ||||
| } | } | ||||
| /* ensure a color exists and is assigned to object */ | /* ensure a color exists and is assigned to object */ | ||||
| BKE_gpencil_object_material_ensure_from_active_input_toolsettings(bmain, ob, ts); | BKE_gpencil_object_material_ensure_from_active_input_toolsettings(bmain, ob, ts); | ||||
| /* ensure multiframe falloff curve */ | /* ensure multiframe falloff curve */ | ||||
| if (ts->gp_sculpt.cur_falloff == NULL) { | if (ts->gp_sculpt.cur_falloff == NULL) { | ||||
| ts->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); | ts->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); | ||||
| ▲ Show 20 Lines • Show All 1,182 Lines • Show Last 20 Lines | |||||