diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-12 15:52:09 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-12 15:52:09 +0400 |
commit | 5a878c50ebe88eb6d41977a6f8c9201ec527b061 (patch) | |
tree | d90d8dfb855324cc142aab556faf3b7f674dbc96 /source/blender | |
parent | 30b3907128d2b7f6523158dcea2cac9668706cb9 (diff) |
Fixed issue with drag-n-drop into Clip Editor.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 9d1f52568b4..948b6490331 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -239,12 +239,12 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) strncpy(path, U.textudir, sizeof(path)); } + if (RNA_struct_property_is_set(op->ptr, "files")) + return open_exec(C, op); + if (!RNA_struct_property_is_set(op->ptr, "relative_path")) RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); - if (RNA_struct_property_is_set(op->ptr, "filepath")) - return open_exec(C, op); - open_init(C, op); clip_filesel(C, op, path); diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 0a6a4af6960..13caf0b51fe 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -792,8 +792,16 @@ static int clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(eve static void clip_drop_copy(wmDrag *drag, wmDropBox *drop) { - /* copy drag path to properties */ - RNA_string_set(drop->ptr, "filepath", drag->path); + PointerRNA itemptr; + char dir[FILE_MAX], file[FILE_MAX]; + + BLI_split_dirfile(drag->path, dir, file, sizeof(dir), sizeof(file)); + + RNA_string_set(drop->ptr, "directory", dir); + + RNA_collection_clear(drop->ptr, "files"); + RNA_collection_add(drop->ptr, "files", &itemptr); + RNA_string_set(&itemptr, "name", file); } /* area+region dropbox definition */ |