EnviralDesign / TD-UberGui

UberGui is a lightweight multi-threaded, webRender UI module for TouchDesigner
MIT License
73 stars 5 forks source link

RFE: drag and drop callbacks #6

Open drmbt opened 3 years ago

drmbt commented 3 years ago

this is probably something that should wait for the next stable to drop, which should be any day now, but I'd imagine it wouldn't be too difficult to implement a drag/drop from the left half initParName, or the ability to receive drop arguments in those object fields you fixed. The new drag/drop callbacks system Ivan built is great (still experimental for now), would love it if i could access those pars still on click/drag or even hover. In the meantime if i wanted to get hacky, is there a best place if i wanted to grab that par/tuplet now? Is 'initParName' or 'forcedParName' in the 'chopexec_lselect' storage the best place to access that? A lot of the GUIs I've been building lately are grabbing this info from parameterCOMPs, your solution would be much more elegant for my use cases if I could access that info directly

EnviralDesign commented 3 years ago

ya this is an interesting idea, think this wouldn't be too hard to implement, since the hover interact function updates the web pick with the latest parameter name.

what functionality are you envisioning for drag? and what for drop? I also haven't read up on how the newest drag/drop differs from current/older kind, so I might hold off on this a bit till I have a better idea how to generalize it. If you have any thoughts do let me know!

drmbt commented 3 years ago

https://docs.derivative.ca/Experimental:Drag-and-Drop you can read up on new drag/drop, check out the latest experimental when you get a chance. Its a callback system that is significantly more robust then the legacy system

I have a few use cases, including things like executing randomization of rolloverPars with hotkeys, copying everything from a hovered rolloverPar using TDJson to be pasted as a new customPar on another component, and a suite of MacroUI elements (buttons/knobs/faders) that behave like Resolume's dashboard knobs; drop any par onto them and they add its path to a table where range/inversion can be specified, and then push ranged values back to the pars. Its a way to create powerful Macroknobs that control a bunch of parameters throughout a sweet spot from a single midi-mappable action.

What i would want from hover is to have an accessible place to get the address of that par, either from storage or as a read only parameter, and from drag/drop, a layer that passes the referenced parameter instead of the UG representation of it

drmbt commented 3 years ago

Is there currently a storage object or reference on click that could return the target parameter in a way that is accessible? I've been digging into the drag drop callbacks system could prototype some behaviors if I knew the most dependable place to get that.

A storage reference would work, but maybe just pushing the on click hovered parameter to a read only Python parameter would be user friendly?

EnviralDesign commented 3 years ago

posted up a new branch for 4.1.0, where the current middle mouse driven selection and drag n drop is functioning! Let me know how it goes :)