Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-05 07:31:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-05 07:31:25 +0300
commit8b31f6fb2169e7163767e382adbef13587305aca (patch)
tree23609feb5da08a39f8009eb4390f69e6205fc2b1 /source/blender/editors/sculpt_paint/sculpt_uv.c
parent8fcc04edce53c5b3b01bf392e1667878ebcce0ef (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/sculpt_uv.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c7
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(