Needing to implement some dropping behaviour in list UI widget from the palette I see that has this as target for dropped node:
./dropUpdater
However this node does not seem to exist. As a result, callbacks such as onDrop() do not seem to be working. I’ve written my own onDrop script to handle drop callbacks but would be nice to be able to use the methods as described in the documentation for list and lister:
Okay I see what you’re talking about. That dropUpdater script looks like it’s ignored. If I add this into my list callbacks DAT, everything seems to work. Definitely post (or send me) examples of problems and what you’re trying to do.
Yeahhh. listCOMPs are weird in that they have their own drag/drop system for cells. This one was set to legacy drag/drop system in the drop par, which is the standard node system. It was intercepting the drag/drop.
You need two things to make this work…
turn ‘drop’ par (On Dropping Into) to Use Parent’s Drop Settings. I know this is weird, and it’s something we’re working on internally as we develop a new drag/drop system. But that is the setting you want.
You need an onDropHover callback. Listers (and raw listCOMPs) need to return True in the hover callback in order to receive the drop callback. So use the callbacks in my comment above to get started.
As I look at this, the gotchas are striking. The legacy drag/drop system leaves a lot to be desired, and we are in the process of developing a much better one.
So the last thing that was tripping me up - and may be tripping up @dylanroscover as well - is that you need a row to drop something onto. Said another way, you need an empty that will act as a receiver for your data. @Ivan am I understanding that correctly?
I was imagining that you could do something like drag onto an empty lister and dynamical construct new rows, and couldn’t figure out what I was doing wrong.
I’m sure there’s an approach - just thinking about dragging from one lister to another, and wanting to dynamically create a new list from a source.
Would be great if your info from this thread could get passed into the Lister Wiki page, or at the very least, the page could be flagged as “In Development.” Cheers.
Foof. Looking at this, I think I was wrong about having to change the drop script. It works for me even if I set to ‘Legacy’ with sys/drop. So that doesn’t seem to be the problem, which makes me think it’s something else that is being tricky.
Keep the test cases coming if you guys unearth any more weirdness, please!
Yeah the more I play with this, the more it seems like some kind of intermittent state error. Sometimes it works for me and sometimes it doesn’t. That gets into C++ problems that may take more research to unravel. Thanks for bringing this to my attention
This is what I (re)discovered today: If you don’t return True from the onDropHover callback, the regular node drag/drop system is invoked. This means that if a drop script is provided, it will be run.
So if you get an onDropHover callback and you don’t return True and you have /sys/drop as your drop script, it’s going to drop the operator into your lister. Rarely what you want when dropping an operator onto a cell!
I’m going to change some default settings to make it harder to fall into this trap.
Is everyone here able to make this work on a basic level? I know the settings are finicky, but you should be able to get drops onto your lister as long as:
lister’s On Dropping Into (Drag/Drop page) is not set to “Do Not Allow Drop”
you have an onDropHover callback (returning True if you want the drop)
Off Cell Callbacks (List page) parameter is set to on
I think I finally understand how this is working. Attached is a simple example that lets you drag from one lister to another appending data to a table.