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:
authorCampbell Barton <ideasman42@gmail.com>2015-06-17 08:57:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-06-17 09:05:35 +0300
commit364d934951e3a46864d6478309345a3b10e67818 (patch)
tree6c14913aa482415a71926529ce3384b794cce8dc /source/blender/editors/space_image/image_ops.c
parenta1c6b73de7c93a5320b274f58e3e1a73e03e7389 (diff)
Fix T45059: Image open /w relative paths & anim
- would hang on win32 (checking network share?) - made the path absolute on all systems
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r--source/blender/editors/space_image/image_ops.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index b76cf4e61f4..72e3f21b1be 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1081,15 +1081,27 @@ static int image_open_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", path);
- if (!IMB_isanim(path) && RNA_struct_property_is_set(op->ptr, "files") &&
- RNA_struct_property_is_set(op->ptr, "directory"))
+ if (RNA_struct_property_is_set(op->ptr, "directory") &&
+ RNA_struct_property_is_set(op->ptr, "files"))
{
- ListBase frames;
-
- BLI_listbase_clear(&frames);
- image_sequence_get_frames(op->ptr, &frames, path, sizeof(path));
- frame_seq_len = image_sequence_get_len(&frames, &frame_ofs);
- BLI_freelistN(&frames);
+ /* only to pass to imbuf */
+ char path_full[FILE_MAX];
+ BLI_strncpy(path_full, path, sizeof(path_full));
+ BLI_path_abs(path_full, G.main->name);
+
+ if (!IMB_isanim(path_full)) {
+ bool was_relative = BLI_path_is_rel(path);
+ ListBase frames;
+
+ BLI_listbase_clear(&frames);
+ image_sequence_get_frames(op->ptr, &frames, path, sizeof(path));
+ frame_seq_len = image_sequence_get_len(&frames, &frame_ofs);
+ BLI_freelistN(&frames);
+
+ if (was_relative) {
+ BLI_path_rel(path, G.main->name);
+ }
+ }
}
errno = 0;