diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-24 00:00:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-24 00:05:24 +0300 |
commit | 888ab78edfad4f9c2bdd31764eb95eb347a8c2d8 (patch) | |
tree | f7d60d20fa245facea2963d483eb6cf40d656101 /source/blender/blenkernel/intern/image.c | |
parent | 48a720055f736c5be257f85c22589f81f09247a8 (diff) |
Minor edits to T42649 fix
- only modify paths for newly loaded images
- don't attempt to read from library paths
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 54f5cb7a68e..eaf173a7382 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -661,7 +661,7 @@ Image *BKE_image_load(Main *bmain, const char *filepath) /* otherwise creates new. */ /* does not load ibuf itself */ /* pass on optional frame for #name images */ -Image *BKE_image_load_exists(const char *filepath) +Image *BKE_image_load_exists_ex(const char *filepath, bool *r_exists) { Image *ima; char str[FILE_MAX], strtest[FILE_MAX]; @@ -681,16 +681,24 @@ Image *BKE_image_load_exists(const char *filepath) ima->id.us++; /* officially should not, it doesn't link here! */ if (ima->ok == 0) ima->ok = IMA_OK; - /* RETURN! */ + if (r_exists) + *r_exists = true; return ima; } } } } + if (r_exists) + *r_exists = false; return BKE_image_load(G.main, filepath); } +Image *BKE_image_load_exists(const char *filepath) +{ + return BKE_image_load_exists_ex(filepath, NULL); +} + static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, const float color[4], ColorManagedColorspaceSettings *colorspace_settings) { |