Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Yurkovich <jesse.y@gmail.com>2021-08-18 07:42:28 +0300
committerJesse Yurkovich <jesse.y@gmail.com>2021-08-18 07:44:36 +0300
commit400cb25fc77a4131033f69cf328a31cdcf81edb5 (patch)
treee88d1f14569ddefaa0fe2b75401498fbf84b9af6 /source/blender/makesrna/intern/rna_image.c
parentf41beca97787d017a437a63cc0da2ce991522dea (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/makesrna/intern/rna_image.c')
-rw-r--r--source/blender/makesrna/intern/rna_image.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index c058ab6cfcc..e44ddb07d53 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -290,15 +290,10 @@ static void rna_UDIMTile_tile_number_set(PointerRNA *ptr, int value)
ImageTile *tile = (ImageTile *)ptr->data;
Image *image = (Image *)ptr->owner_id;
- /* The index of the first tile can't be changed. */
- if (tile->tile_number == 1001) {
- return;
- }
-
/* Check that no other tile already has that number. */
ImageTile *cur_tile = BKE_image_get_tile(image, value);
- if (cur_tile == NULL || cur_tile == tile) {
- tile->tile_number = value;
+ if (cur_tile == NULL) {
+ BKE_image_reassign_tile(image, tile, value);
}
}