[Bf-taskforce25] Drag & Drop into 2.5

Brecht Van Lommel brecht at blender.org
Wed Jul 22 15:18:59 CEST 2009


Hi,

I don't have much to comment, the basic architecture for this sounds
fine.

On Mon, 2009-07-20 at 14:37 +0200, Elia Sarti wrote:
> Details and Issues
> 
> If I'm not mistaken as of now Context only returns "active" 
> window/space/area/region in terms of what it was when the event was 
> generated. It would be nice to have both "active" and "target" with 
> target being the "active" in terms of where the mouse pointer or input are.
> I'm not sure this is really necessary but we just need a way to retrieve 
> drag data from where the MOUSEDRAG was generated and drop data from 
> where the MOUSEDROP is generated.
> I admit I didn't look much at the code yet so I could be wrong. Maybe 
> this can already be done? For instance, if we do the 
> MOUSEDRAG-associated operator modal then maybe we can catch the 
> MOUSEDROP event in the modal() callback, set some custom data in it and 
> then tell the system to keep on broadcasting the event? I'm not sure 
> this is doable and in that case how much of a hack it is.

One thing I don't fully understand is if MOUSEDRAG and MOUSEDROP would
be handled by two separate operators or a single one? I presume it would
be two different ones, because that is more extensible. Now, in that
case I think the active/target context issue can be solved by giving the
MOUSEDRAG operator the active context and MOUSEDROP the target context.

This may require some WM tweaks, depending on how the handover between
the two will work, but it's probably quite simple. Modal ops for example
already keep the original context they were started in, so if MOUSEDRAG
is a modal op it keeps the original context, then you stop the operator,
and start a new MOUSEDROP operator which will get the context based on
where the mouse is again.

Brecht.



More information about the Bf-taskforce25 mailing list