Fix #22894: sequencer drag & drop wasn't working anymore.
This commit is contained in:
parent
64de3feb37
commit
969c0fd718
|
@ -341,6 +341,9 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
|
|||
|
||||
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_exec(bContext *C, wmOperator *op)
|
|||
|
||||
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_exec(bContext *C, wmOperator *op)
|
|||
|
||||
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;
|
||||
|
|
|
@ -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 int sound_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
|
|||
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 */
|
||||
|
|
Loading…
Reference in New Issue