[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48860] trunk/blender/source/blender/ editors/space_clip: Fixed issue with drag-n-drop into Clip Editor.
Sergey Sharybin
sergey.vfx at gmail.com
Thu Jul 12 13:52:10 CEST 2012
Revision: 48860
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48860
Author: nazgul
Date: 2012-07-12 11:52:09 +0000 (Thu, 12 Jul 2012)
Log Message:
-----------
Fixed issue with drag-n-drop into Clip Editor.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_clip/clip_ops.c
trunk/blender/source/blender/editors/space_clip/space_clip.c
Modified: trunk/blender/source/blender/editors/space_clip/clip_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_ops.c 2012-07-12 11:35:51 UTC (rev 48859)
+++ trunk/blender/source/blender/editors/space_clip/clip_ops.c 2012-07-12 11:52:09 UTC (rev 48860)
@@ -239,12 +239,12 @@
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);
Modified: trunk/blender/source/blender/editors/space_clip/space_clip.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/space_clip.c 2012-07-12 11:35:51 UTC (rev 48859)
+++ trunk/blender/source/blender/editors/space_clip/space_clip.c 2012-07-12 11:52:09 UTC (rev 48860)
@@ -792,8 +792,16 @@
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 */
More information about the Bf-blender-cvs
mailing list