[Bf-blender-cvs] [b6bb6d1] master: Fix T38808: image opened with 'relative path', gets absolute path
Dalai Felinto
noreply at git.blender.org
Tue Feb 25 01:09:23 CET 2014
Commit: b6bb6d1b2c6f16c3c325242d15ef6d65d40f1a74
Author: Dalai Felinto
Date: Tue Feb 25 11:06:11 2014 +1100
https://developer.blender.org/rBb6bb6d1b2c6f16c3c325242d15ef6d65d40f1a74
Fix T38808: image opened with 'relative path', gets absolute path
===================================================================
M source/blender/editors/space_image/image_ops.c
===================================================================
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index bb7a9b9..de1dfff 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1025,6 +1025,7 @@ static int image_sequence_get_len(ListBase *frames, int *ofs)
static int image_open_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
SpaceImage *sima = CTX_wm_space_image(C); /* XXX other space types can call */
Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
@@ -1036,6 +1037,8 @@ static int image_open_exec(bContext *C, wmOperator *op)
int frame_seq_len = 0;
int frame_ofs = 1;
+ const bool is_relative_path = RNA_boolean_get(op->ptr, "relative_path");
+
if (RNA_struct_property_is_set(op->ptr, "files") && RNA_struct_property_is_set(op->ptr, "directory")) {
ListBase frames;
@@ -1062,6 +1065,12 @@ static int image_open_exec(bContext *C, wmOperator *op)
if (!op->customdata)
image_open_init(C, op);
+ /* only image path after save, never ibuf */
+ if (is_relative_path) {
+ const char *relbase = ID_BLEND_PATH(bmain, &ima->id);
+ BLI_path_rel(ima->name, relbase);
+ }
+
/* hook into UI */
iod = op->customdata;
More information about the Bf-blender-cvs
mailing list