diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-11-13 19:21:17 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-11-13 19:25:49 +0300 |
commit | 9bd0d8b5505ab51a48c9714f6a8dc555258d02af (patch) | |
tree | 23bd6f61b59ef7e9ba4669fe453ebfdae6ca0638 /source/blender/blenloader | |
parent | fe86375d1c636a6ba95f0f9e9a0b4a9fdd883030 (diff) |
Sculpt: Sculpt template defaults
This commit includes all changes listed in T71366 except for the 2 column toolbar layout.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6225
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 9fce89558b6..45fb62a4ac0 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -46,6 +46,7 @@ #include "BKE_layer.h" #include "BKE_library.h" #include "BKE_main.h" +#include "BKE_mesh.h" #include "BKE_node.h" #include "BKE_paint.h" #include "BKE_screen.h" @@ -230,6 +231,25 @@ void BLO_update_defaults_workspace(WorkSpace *workspace, const char *app_templat if (STREQ(workspace->id.name + 2, "Drawing")) { workspace->object_mode = OB_MODE_PAINT_GPENCIL; } + + /* For Sculpting template. */ + if (STREQ(workspace->id.name + 2, "Sculpting")) { + for (WorkSpaceLayout *layout = layouts->first; layout; layout = layout->next) { + bScreen *screen = layout->screen; + if (screen) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) { + if (sa->spacetype == SPACE_VIEW3D) { + View3D *v3d = sa->spacedata.first; + v3d->shading.flag &= ~V3D_SHADING_CAVITY; + copy_v3_fl(v3d->shading.single_color, 1.0f); + STRNCPY(v3d->shading.matcap, "basic_1"); + } + } + } + } + } + } } } @@ -385,6 +405,13 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) for (Mesh *mesh = bmain->meshes.first; mesh; mesh = mesh->id.next) { /* Match default for new meshes. */ mesh->smoothresh = DEG2RADF(30); + + /* For Sculpting template. */ + if (app_template && STREQ(app_template, "Sculpting")) { + mesh->remesh_voxel_size = 0.035f; + mesh->flag |= ME_REMESH_FIX_POLES | ME_REMESH_REPROJECT_VOLUME; + BKE_mesh_smooth_flag_set(mesh, false); + } } for (Camera *camera = bmain->cameras.first; camera; camera = camera->id.next) { |