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>2022-05-28 08:11:52 +0300
committerJesse Yurkovich <jesse.y@gmail.com>2022-05-28 08:11:52 +0300
commit86baf6e3edc8925c0701786550b2bac8fe5203d3 (patch)
tree872019c956476ca0e02a6fb1c27768bfb974aa10 /source/blender/editors/space_image
parent967f96ee2e2ed454034f3e6be53fc7259f9016d0 (diff)
Re-fix T97366: Support single-file UDIMs
The original fix for T97366 was too restrictive and breaks real-world cases of single-file UDIM textures. See D13297 for an example. This patch effectively reverts the original fix and instead fixes the downstream code to accept single-file ranges as necessary. Note: This means it is very important for users to make use of the "UDIM detection" option during `image.open` or drag n' drop scenarios in order to declare their intent when loading their files. Differential Revision: https://developer.blender.org/D14853
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_ops.c6
-rw-r--r--source/blender/editors/space_image/image_sequence.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index aa77aab2283..68d342e2143 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1274,8 +1274,8 @@ static Image *image_open_single(Main *bmain,
BKE_image_free_views(ima);
}
- if ((range->length > 1) && (ima->source == IMA_SRC_FILE)) {
- if (range->udim_tiles.first) {
+ if (ima->source == IMA_SRC_FILE) {
+ if (range->udims_detected && range->udim_tiles.first) {
ima->source = IMA_SRC_TILED;
ImageTile *first_tile = ima->tiles.first;
first_tile->tile_number = range->offset;
@@ -1283,7 +1283,7 @@ static Image *image_open_single(Main *bmain,
BKE_image_add_tile(ima, POINTER_AS_INT(node->data), NULL);
}
}
- else {
+ else if (range->length > 1) {
ima->source = IMA_SRC_SEQUENCE;
}
}
diff --git a/source/blender/editors/space_image/image_sequence.c b/source/blender/editors/space_image/image_sequence.c
index 365cf2542b2..fbeef47e278 100644
--- a/source/blender/editors/space_image/image_sequence.c
+++ b/source/blender/editors/space_image/image_sequence.c
@@ -107,10 +107,10 @@ static void image_detect_frame_range(ImageFrameRange *range, const bool detect_u
/* UDIM */
if (detect_udim) {
int udim_start, udim_range;
- bool result = BKE_image_get_tile_info(
+ range->udims_detected = BKE_image_get_tile_info(
range->filepath, &range->udim_tiles, &udim_start, &udim_range);
- if (result) {
+ if (range->udims_detected) {
range->offset = udim_start;
range->length = udim_range;
return;