[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30594] trunk/blender/source/blender/ editors/space_sequencer: Fix #22894: sequencer drag & drop wasn' t working anymore.
Brecht Van Lommel
brecht at blender.org
Wed Jul 21 19:37:41 CEST 2010
Revision: 30594
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30594
Author: blendix
Date: 2010-07-21 19:37:40 +0200 (Wed, 21 Jul 2010)
Log Message:
-----------
Fix #22894: sequencer drag & drop wasn't working anymore.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_sequencer/sequencer_add.c
trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c
Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_add.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_add.c 2010-07-21 16:49:43 UTC (rev 30593)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_add.c 2010-07-21 17:37:40 UTC (rev 30594)
@@ -341,6 +341,9 @@
static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ if(RNA_collection_length(op->ptr, "files") || RNA_property_is_set(op->ptr, "filepath"))
+ return sequencer_add_movie_strip_exec(C, op);
+
if(!ED_operator_sequencer_active(C)) {
BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
return OPERATOR_CANCELLED;
@@ -389,6 +392,9 @@
static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ if(RNA_collection_length(op->ptr, "files") || RNA_property_is_set(op->ptr, "filepath"))
+ return sequencer_add_sound_strip_exec(C, op);
+
if(!ED_operator_sequencer_active(C)) {
BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
return OPERATOR_CANCELLED;
@@ -486,6 +492,9 @@
static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
+ if(RNA_collection_length(op->ptr, "files"))
+ return sequencer_add_image_strip_exec(C, op);
+
if(!ED_operator_sequencer_active(C)) {
BKE_report(op->reports, RPT_ERROR, "Sequencer area not active");
return OPERATOR_CANCELLED;
Modified: trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c 2010-07-21 16:49:43 UTC (rev 30593)
+++ trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c 2010-07-21 17:37:40 UTC (rev 30594)
@@ -35,6 +35,7 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
+#include "BLI_path_util.h"
#include "BKE_context.h"
#include "BKE_screen.h"
@@ -322,7 +323,20 @@
static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
{
/* copy drag path to properties */
- RNA_string_set(drop->ptr, "filepath", drag->path);
+ if(RNA_struct_find_property(drop->ptr, "filepath"))
+ RNA_string_set(drop->ptr, "filepath", drag->path);
+
+ if(RNA_struct_find_property(drop->ptr, "directory")) {
+ PointerRNA itemptr;
+ char dir[FILE_MAX], file[FILE_MAX];
+
+ BLI_split_dirfile(drag->path, dir, file);
+
+ RNA_string_set(drop->ptr, "directory", dir);
+
+ RNA_collection_add(drop->ptr, "files", &itemptr);
+ RNA_string_set(&itemptr, "name", file);
+ }
}
/* this region dropbox definition */
More information about the Bf-blender-cvs
mailing list