diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-05 07:31:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-05 07:31:25 +0300 |
commit | 8b31f6fb2169e7163767e382adbef13587305aca (patch) | |
tree | 23609feb5da08a39f8009eb4390f69e6205fc2b1 /source/blender/editors/sculpt_paint | |
parent | 8fcc04edce53c5b3b01bf392e1667878ebcce0ef (diff) |
Paint: add BKE_paint_ensure to initialize toolsettings
Each mode had its own logic for initializing paint structs,
move to a single function.
Also remove "BKE_brush_get_gpencil_paint", entering grease pencil
mode is responsible for ensuring the data is created.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_uv.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 897539bddd7..c5cebed0b8b 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -236,15 +236,12 @@ void ED_space_image_uv_sculpt_update(Main *bmain, wmWindowManager *wm, Scene *sc { ToolSettings *settings = scene->toolsettings; if (settings->use_uv_sculpt) { - if (!settings->uvsculpt) { - settings->uvsculpt = MEM_callocN(sizeof(*settings->uvsculpt), "UV Smooth paint"); + if (settings->uvsculpt == NULL) { settings->uv_sculpt_tool = UV_SCULPT_TOOL_GRAB; settings->uv_sculpt_settings = UV_SCULPT_LOCK_BORDERS | UV_SCULPT_ALL_ISLANDS; settings->uv_relax_method = UV_SCULPT_TOOL_RELAX_LAPLACIAN; - /* Uv sculpting does not include explicit brush view control yet, always enable */ - settings->uvsculpt->paint.flags |= PAINT_SHOW_BRUSH; } - + BKE_paint_ensure(settings, (Paint **)&settings->uvsculpt); BKE_paint_init(bmain, scene, ePaintSculptUV, PAINT_CURSOR_SCULPT); settings->uvsculpt->paint.paint_cursor = WM_paint_cursor_activate( |