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:
authorJacques Lucke <jacques@blender.org>2021-11-02 13:15:05 +0300
committerJacques Lucke <jacques@blender.org>2021-11-02 13:17:12 +0300
commit0c3b215e7d5456878b155d13440864f49ad1f230 (patch)
tree1a405cfe6fbf632442d6ce03821e1828d581bcf4 /source/blender/blenloader
parent2b3becf2be27286d68a49328a13c327d2fa94aeb (diff)
Images: refactor how failed image load attempts are remembered
Previously, `ImageTile->ok` and `ImageUser->ok` were used to indicate whether an image failed to load. There were three possible values which (probably) had the following meanings: * `0`: There was an error while loading the image. Don't try to load again. * `1`: Default value. Try to load the image. * `2`: The image was loaded successfully. This image-wide flag did not make sense unfortunately, because loading may work for some frames of an image sequence but not for others. Remember than an image data block can also contain a movie. The purpose of the `->ok` flag was to serve as an optimization to avoid trying to load a file over and over again when there is an error (e.g. the file does not exist or is invalid). To get the optimization back, the patch is changing `MovieCache` so that it can also cache failed load attempts. As a consequence, `ibuf` is allowed to be `NULL` in a few more places. I added the appropriate null checks. This also solves issues when image sequences are used with the Image Texture node in Geometry nodes (also see D12827). Differential Revision: https://developer.blender.org/D12957
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_260.c1
-rw-r--r--source/blender/blenloader/intern/versioning_280.c1
-rw-r--r--source/blender/blenloader/intern/versioning_legacy.c2
3 files changed, 0 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 55252210a78..c4d04392cba 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -1384,7 +1384,6 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
tex->iuser.frames = 1;
tex->iuser.sfra = 1;
- tex->iuser.ok = 1;
}
}
}
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index e809d580fd2..4333bdb851c 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -4517,7 +4517,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (!DNA_struct_elem_find(fd->filesdna, "Image", "ListBase", "tiles")) {
for (Image *ima = bmain->images.first; ima; ima = ima->id.next) {
ImageTile *tile = MEM_callocN(sizeof(ImageTile), "Image Tile");
- tile->ok = 1;
tile->tile_number = 1001;
BLI_addtail(&ima->tiles, tile);
}
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index 62cc2aa3662..37bf4898cb3 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -391,7 +391,6 @@ static void do_version_ntree_242_2(bNodeTree *ntree)
iuser->sfra = nia->sfra;
iuser->offset = nia->nr - 1;
iuser->cycl = nia->cyclic;
- iuser->ok = 1;
node->storage = iuser;
MEM_freeN(nia);
@@ -399,7 +398,6 @@ static void do_version_ntree_242_2(bNodeTree *ntree)
else {
ImageUser *iuser = node->storage = MEM_callocN(sizeof(ImageUser), "node image user");
iuser->sfra = 1;
- iuser->ok = 1;
}
}
}