From df2ab4e758c73bc72a95fcc02ac1e711bbd86b17 Mon Sep 17 00:00:00 2001 From: Simon Lenz Date: Thu, 16 Jun 2022 10:13:03 +0200 Subject: Mask Editor: Add toggle for mask spline drawing Adds an overlay option to show/hide the spline points & lines of masks in the Mask Editor. It also moves the "smooth" option up (its position left of the selection dropdown was missleading). {F11847272} This emerged from a discussion in https://developer.blender.org/D12776 Differential Revision: https://developer.blender.org/D13314 --- source/blender/blenloader/intern/versioning_300.c | 16 ++++++++++++++++ source/blender/blenloader/intern/versioning_defaults.c | 2 ++ 2 files changed, 18 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 5af42f9f1f6..eac27bc57ed 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -30,6 +30,7 @@ #include "DNA_gpencil_modifier_types.h" #include "DNA_lineart_types.h" #include "DNA_listBase.h" +#include "DNA_mask_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_modifier_types.h" @@ -3096,6 +3097,21 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 303, 3)) { + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype == SPACE_CLIP) { + ((SpaceClip *)sl)->mask_info.draw_flag |= MASK_DRAWFLAG_SPLINE; + } + else if (sl->spacetype == SPACE_IMAGE) { + ((SpaceImage *)sl)->mask_info.draw_flag |= MASK_DRAWFLAG_SPLINE; + } + } + } + } + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 91b2f509a7f..6ce53e4a648 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -23,6 +23,7 @@ #include "DNA_curveprofile_types.h" #include "DNA_gpencil_types.h" #include "DNA_light_types.h" +#include "DNA_mask_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" @@ -185,6 +186,7 @@ static void blo_update_defaults_screen(bScreen *screen, SpaceClip *sclip = area->spacedata.first; sclip->around = V3D_AROUND_CENTER_MEDIAN; sclip->mask_info.blend_factor = 0.7f; + sclip->mask_info.draw_flag = MASK_DRAWFLAG_SPLINE; } } -- cgit v1.2.3