[Bf-committers] Drag'n'drop feature initiated

Campbell Barton ideasman42 at gmail.com
Tue Nov 17 10:07:12 CET 2009

Hi Damien, great to see you working on this.
We could use an operator that makes the decision what to do based on
the file contents.

Some possibilities..
- look at the space type, eg. multiple images in the image view might
work differently to the sequencer.
- Each importer operator could have a poll function that reads the
file headers so we could DND collada/3ds/obj etc.
- Maybe define ways to DND blend files in a way that applies their
material to the active model, or appends their contents, worth
thinking of some ways it could be used though it may be better just to
load the blend files too.

If nobody else does I might try X11 support tho its not high priority arm.

On Tue, Nov 17, 2009 at 9:57 AM, Damien Plisson <damien.plisson at yahoo.fr> wrote:
> Hi all,
> I've started the implementation of the drag'n'drop feature by implementing it in ghost, with a new event type (class GHOST_EventDragnDrop) that is meant to be os independent.
> The dragging sequence is performed in four phases:
> - Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started. Already gives the object data type, and the entering mouse location
> - Update mouse position (GHOST_kEventDraggingUpdated) sent upon each mouse move until the drag'n'drop operation stops, to give the updated mouse position.
> Useful to highlight a potential destination, and update the status (through GHOST_setAcceptDragOperation) telling if the object can be dropped at the current cursor position.
> - Abort drag'n'drop sequence (GHOST_kEventDraggingExited) sent when the user moved the mouse outside the window.
> - Send the dropped data (GHOST_kEventDraggingDropDone)
> - Outside of the normal sequence, dropped data can be directly sent (GHOST_kEventDraggingDropOnIcon). This can happen when the user drops an object on the application icon. (Also used in OSX to pass the filename of the document the user doubled-clicked in the finder). But in this event, no mouse coordinates are set.
> The "dropped object" data is freed upon event object release (already handled in the event dispatch loop).
> And the mouse position is sent directly in blender client coordinates (y=0 at bottom).
> The GHOST_setAcceptDragOperation(TRUE) call must be placed before the user drops the object for it to be accepted.
> Current handled data types :
> - Text string (meant to be any string but filename, type = char *)
> - Array of filenames (full paths, type = GHOST_TStringArray )
> - Bitmap image (not implemented yet - is it available in x11 & win ?)
> The ghost, and its mac implementation are already in svn.
> So now, feel free to make use of these events in the various blender features (e.g. sequencer, ...), and for x11 & win coders to implement it on their platforms !
> Cheers,
> Damien
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

- Campbell

More information about the Bf-committers mailing list