Drag and Drop - Python

Hi All,

So I’ve been looking through the wiki, and I can’t seem to find the Python Equivalents for the Drag and Drop TScript args [url]http://www.derivative.ca/wiki088/index.php?title=Drag-and-Drop[/url]. Where’s the right place to start looking?

Thanks!
Matthew

You using it with a panel?

Most args like $arg0 $arg1 become args[0], args[1], etc etc

So you can make a Text DAT inside of a panel, put:

print(args[0])

Then in the panel drag and drop settings, point it at that script, then drop something onto the panel.

Im not at my machine to 100% test that, but I did a project with that recently and that’s what I remember doing.

Where to look? That’s a tougher question to answer…

elburz, you’re brilliant!!

Thank you for this.

M

wrote up something here for posterity

[url]http://matthewragan.com/2015/05/30/touchdesigner-drop-scripts/[/url]

Thanks for all the above. Is there a way for the script to identify the context it was called in - e.g. id the container that called it?

Otherwise it looks like you need to have a one-to-one relationship between drop-able OP and script

EDIT - Answered my own question:
print(args) returns a list containing calling OP

(‘C:/Users/ModProds/Desktop/moad_video.txt’, ‘0’, ‘0’, ‘0’, ‘1’, ‘txt’, ‘moad_video’, ‘/filebrowser/track1’)