[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47866] trunk/blender/source/blender/ editors/space_sequencer/space_sequencer.c: Sequencer Drag & Drop -- disallow dropping on sequences for the current drop_poll functions

Dan Eicher dan at trollwerks.org
Thu Jun 14 06:57:53 CEST 2012


Revision: 47866
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47866
Author:   dna
Date:     2012-06-14 04:57:42 +0000 (Thu, 14 Jun 2012)
Log Message:
-----------
Sequencer Drag & Drop -- disallow dropping on sequences for the current drop_poll functions

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c

Modified: trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c	2012-06-14 03:43:11 UTC (rev 47865)
+++ trunk/blender/source/blender/editors/space_sequencer/space_sequencer.c	2012-06-14 04:57:42 UTC (rev 47866)
@@ -325,27 +325,43 @@
 
 /* ************* dropboxes ************* */
 
-static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
+static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
 {
+	ARegion *ar = CTX_wm_region(C);
+	Scene *scene = CTX_data_scene(C);
+	int hand;
+
 	if (drag->type == WM_DRAG_PATH)
 		if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
-			return 1;
+			if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+				return 1;
+
 	return 0;
 }
 
-static int movie_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
+static int movie_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
 {
+	ARegion *ar = CTX_wm_region(C);
+	Scene *scene = CTX_data_scene(C);
+	int hand;
+
 	if (drag->type == WM_DRAG_PATH)
 		if (ELEM3(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
-			return 1;
+			if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+				return 1;
 	return 0;
 }
 
-static int sound_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
+static int sound_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
 {
+	ARegion *ar = CTX_wm_region(C);
+	Scene *scene = CTX_data_scene(C);
+	int hand;
+
 	if (drag->type == WM_DRAG_PATH)
 		if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) /* rule might not work? */
-			return 1;
+			if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+				return 1;
 	return 0;
 }
 




More information about the Bf-blender-cvs mailing list