diff options
author | Germano Cavalcante <mano-wii> | 2022-03-11 00:33:04 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-03-11 00:47:38 +0300 |
commit | e3de755ae31503284277681b52947c02aef5d411 (patch) | |
tree | 481eb60ba38e1a2fe3522501e162cb599c5468f6 /source/blender/blenloader/intern/versioning_300.c | |
parent | edcb2ad7b3a07f9cd09243cc5fbf5e563e853964 (diff) |
Transform/UI: individualize the option to use snap per editor type
`3DView`'s `use_snap` option has little or nothing to do with using
snapping in `UV`, `Nodes` or `Sequencer`.
So there are no real advantages to keeping these options in sync.
Therefore, individualize the option to use snap for each "spacetype".
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D13310
Diffstat (limited to 'source/blender/blenloader/intern/versioning_300.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 32dcb977110..37356e58132 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -1481,6 +1481,10 @@ static void version_liboverride_rnacollections_insertion_animdata(ID *id) /* NOLINTNEXTLINE: readability-function-size */ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) { + /* The #SCE_SNAP_SEQ flag has been removed in favor of the #SCE_SNAP which can be used for each + * snap_flag member individually. */ + const int SCE_SNAP_SEQ = (1 << 7); + if (!MAIN_VERSION_ATLEAST(bmain, 300, 1)) { /* Set default value for the new bisect_threshold parameter in the mirror modifier. */ if (!DNA_struct_elem_find(fd->filesdna, "MirrorModifierData", "float", "bisect_threshold")) { @@ -2585,5 +2589,16 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) ts->uv_relax_method = UV_SCULPT_TOOL_RELAX_LAPLACIAN; } } + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + ToolSettings *tool_settings = scene->toolsettings; + tool_settings->snap_flag_seq = tool_settings->snap_flag & ~(SCE_SNAP | SCE_SNAP_SEQ); + if (tool_settings->snap_flag & SCE_SNAP_SEQ) { + tool_settings->snap_flag_seq |= SCE_SNAP; + tool_settings->snap_flag &= ~SCE_SNAP_SEQ; + } + + tool_settings->snap_flag_node = tool_settings->snap_flag; + tool_settings->snap_uv_flag |= tool_settings->snap_flag & SCE_SNAP; + } } } |