[Bf-blender-cvs] [6fd45a110cf] asset-browser-snap-dragging: Only hide preview image while dragging over 3D View

Julian Eisel noreply at git.blender.org
Mon Oct 11 16:41:39 CEST 2021


Commit: 6fd45a110cfb13015764ae70c7967b0f8f5a4f3b
Author: Julian Eisel
Date:   Mon Oct 11 16:39:35 2021 +0200
Branches: asset-browser-snap-dragging
https://developer.blender.org/rB6fd45a110cfb13015764ae70c7967b0f8f5a4f3b

Only hide preview image while dragging over 3D View

Make the preview hide and unhide depending on if the user drags over the
3D View. In there the preview is too much visual noice, together with
the bounding box and snapping plane we draw there.

===================================================================

M	source/blender/windowmanager/WM_types.h
M	source/blender/windowmanager/intern/wm_dragdrop.c

===================================================================

diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 24bf36455dd..b6947e5263a 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -1032,7 +1032,7 @@ typedef struct wmDrag {
   float scale;
   int sx, sy;
 
-  /** Don't draw the icon or image (`imb`). */
+  /** Don't draw the icon or image (`imb`). Can be set in the `poll()` callback of the drop-box. */
   bool no_preview;
 
   /** If filled, draws operator tooltip/operator name. */
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 8c39b403810..9743153035e 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -392,6 +392,8 @@ static void wm_drop_operator_options(bContext *C, wmDrag *drag, const wmEvent *e
   }
 
   drag->tooltip[0] = 0;
+  /* Allow setting this in the `poll()`. */
+  drag->no_preview = false;
 
   /* check buttons (XXX todo rna and value) */
   if (UI_but_active_drop_name(C)) {



More information about the Bf-blender-cvs mailing list