diff options
author | Chris Blackbourn <chrisbblend@gmail.com> | 2022-09-18 08:03:40 +0300 |
---|---|---|
committer | Chris Blackbourn <chrisbblend@gmail.com> | 2022-09-20 01:00:41 +0300 |
commit | a24fc6bbc1ae3c0ee5a26c5b964af219215de692 (patch) | |
tree | 007f58081ebdc48a90102390796ce7a3deba9971 /source/blender/blenloader | |
parent | 7a67d69ca4fe807ea36c57166b89a6e42c25b909 (diff) |
UV: extend custom grid sizes to set each axis separately
For example, allows a custom UV grid size of 4 x 12.
TODO: Fix snapping with custom UV grid sizes.
Manifest Tasks: T78391
Differential Revision: https://developer.blender.org/D16000
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.cc b/source/blender/blenloader/intern/versioning_300.cc index e789cd66632..8f1f2fa2c17 100644 --- a/source/blender/blenloader/intern/versioning_300.cc +++ b/source/blender/blenloader/intern/versioning_300.cc @@ -2401,11 +2401,6 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } break; } - case SPACE_IMAGE: { - SpaceImage *sima = (SpaceImage *)sl; - sima->custom_grid_subdiv = 10; - break; - } } } } @@ -3426,5 +3421,21 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /* Custom grids in UV Editor have separate X and Y divisions. */ + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + switch (sl->spacetype) { + case SPACE_IMAGE: { + SpaceImage *sima = (SpaceImage *)sl; + sima->custom_grid_subdiv[0] = 10; + sima->custom_grid_subdiv[1] = 10; + break; + } + } + } + } + } } } |