tableUI concept

I’d like to share this concept for using the table COMP for “complex” user interfaces. You define your UI via a table DAT and the tableUI autocreates a user interface based on that table and stores all values in your target COMP’s local variables (which makes it very easy to implement presets). It’s was intended to have only 1 tableUI COMP that can display the UI for all COMPs using the tableUI “framework”, therefore drastically reducing node counts in your projects. But it should be quite easy to modify/extend it so that each COMP has it’s own tableUI.

NOTE: It’s an old (unfinished) project from when the table COMP was first introduced, so everything is Tscript and it needs to be adapted to python …

Here’s a quick overview
You define your UIs in a table DAT called: yourComp/UI_table
PARAM: the name of your parameter/local variable where the values are stored. You can create arrays by using pattern expansion.

PARENT: can be used to group parameters to folders. You need to create a parameter array of TYPE folder and then use one of the folder names in the parent (if you leave PARENT empty you don’t need a folder TYPE parameter)

TYPE: currently it can be folder, string, button, menu, float

LABEL: the parameter label displayed in the UI

TEXT: the text displayed in multi-state gadgets (folder, button, menus)

DEFAULT: default value (ctrl RMB on float gadgets will set value to default)

RANGE: range for float parameters

HEIGHT: height of the gadget

then the UI_table is parsed in a subnet called parseUI_table
this creates a table formatted in the proper way

and it’s output needs to go into a node called UIDef
this is the only node that needs to be present in your comp. In theory you can lock this node and delete the UI_table and parseUI_table nodes

finally you will need to manually create local variables matching your (expanded) parameters
unfortunately this is still a manual step, but you can modify the tableUI COMP to create/delete local variables in the TARGET COMPs when they are loaded

Loading a COMP’s UI
the tableUI itself has a local variable called TARGET. You need to set this one to the fullpath of the COMP who’s UI you want to display. In the demo just run the load_test1-3 scripts

Note that float parameters can be changed by LMB, MMB and RMB

some strange long cooktimes when switching folder tabs (load_test1 and switch between Tab A and Tab B)
local variables are not yet autocreated
no comfortable way to enter expressions into parameters. You have to manually do it by modifying the local variable matching your parameter
no python version
when porting to python, use storage to saves your parameter values and it’s description, this way it should be possible to to create a tableUI just by parsing the storage
Combine it with the cache UI to further speed this up and save memory

Anyway, hope this will be useful to some of you.
tableUI_concept.toe (14.3 KB)
tested with b16360

1 Like

thanks man!
Really appreciated, super useful!