diff options
author | Jesse Yurkovich <jesse.y@gmail.com> | 2021-08-18 07:42:28 +0300 |
---|---|---|
committer | Jesse Yurkovich <jesse.y@gmail.com> | 2021-08-18 07:44:36 +0300 |
commit | 400cb25fc77a4131033f69cf328a31cdcf81edb5 (patch) | |
tree | e88d1f14569ddefaa0fe2b75401498fbf84b9af6 /source/blender/blenkernel/intern/image_gpu.c | |
parent | f41beca97787d017a437a63cc0da2ce991522dea (diff) |
UDIM: Support tile sets that do not start at 1001
Removes the artificial requirement that UDIM tile sets start at 1001.
Blender was already capable of handling sparse tile sets (non-contiguous
tiles) so the restriction around starting at 1001 was unnecessary in
general.
This required fixing a few UDIM-related python bugs around manually
updating the `tile_number` field on images as well. See the differential
for details. No script changes are necessary but they will now work,
correctly, in many more cases.
Differential Revision: https://developer.blender.org/D11859
Diffstat (limited to 'source/blender/blenkernel/intern/image_gpu.c')
-rw-r--r-- | source/blender/blenkernel/intern/image_gpu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image_gpu.c b/source/blender/blenkernel/intern/image_gpu.c index bb7495437bb..d179dd40c33 100644 --- a/source/blender/blenkernel/intern/image_gpu.c +++ b/source/blender/blenkernel/intern/image_gpu.c @@ -108,8 +108,9 @@ static GPUTexture *gpu_texture_create_tile_mapping(Image *ima, const int multivi float array_w = GPU_texture_width(tilearray); float array_h = GPU_texture_height(tilearray); + /* Determine maximum tile number. */ + BKE_image_sort_tiles(ima); ImageTile *last_tile = (ImageTile *)ima->tiles.last; - /* Tiles are sorted by number. */ int max_tile = last_tile->tile_number - 1001; /* create image */ |