diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-30 16:32:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-30 16:32:27 +0300 |
commit | 0d64857c3f2364349475728958fac211b0bad5a2 (patch) | |
tree | fe73096f14f2fef92aba25b4ad77e63e1c079465 /source/blender/blenkernel | |
parent | b5cbc8bb606654a21e25cb616d60c89ac61c65a9 (diff) | |
parent | b3c4a2a8da7f1a243628da852d1b8fdc986cbc25 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index b952859e508..0d55b65fe65 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -256,6 +256,7 @@ void BKE_sculpt_update_mesh_elements( struct MultiresModifierData *BKE_sculpt_multires_active(struct Scene *scene, struct Object *ob); int BKE_sculpt_mask_layers_ensure(struct Object *ob, struct MultiresModifierData *mmd); +void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene); enum { SCULPT_MASK_LAYER_CALC_VERT = (1 << 0), diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 152a882de97..2bf5d12e50e 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -1064,3 +1064,39 @@ int BKE_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd) return ret; } + +void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene) +{ + Sculpt *sd = scene->toolsettings->sculpt; + if (sd == NULL) { + sd = scene->toolsettings->sculpt = MEM_callocN(sizeof(Sculpt), __func__); + + /* Turn on X plane mirror symmetry by default */ + sd->paint.symmetry_flags |= PAINT_SYMM_X; + sd->paint.flags |= PAINT_SHOW_BRUSH; + + /* Make sure at least dyntopo subdivision is enabled */ + sd->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE; + } + + if (!sd->detail_size) { + sd->detail_size = 12; + } + if (!sd->detail_percent) { + sd->detail_percent = 25; + } + if (sd->constant_detail == 0.0f) { + sd->constant_detail = 3.0f; + } + + /* Set sane default tiling offsets */ + if (!sd->paint.tile_offset[0]) { + sd->paint.tile_offset[0] = 1.0f; + } + if (!sd->paint.tile_offset[1]) { + sd->paint.tile_offset[1] = 1.0f; + } + if (!sd->paint.tile_offset[2]) { + sd->paint.tile_offset[2] = 1.0f; + } +} |