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

Charles Wardlaw cwardlaw at marchentertainment.com
Tue Nov 17 14:45:54 CET 2009


That sounds brilliant, Damien! How amazing would it be to be able to  
drag and drop images from a textures folder in the Finder onto the  
Blender icon or into the UV texture window, and have them load? :)

Through this this functionality, would it be possible to have the  
Outliner create text name objects that are droppable into object  
targets, instead of having to manually type object names in as  
constraint targets and such? It's a feature I requested years back. ^_^

~ C


On 2009-11-17, at 3: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


More information about the Bf-committers mailing list