Auto-annotation of parameter names

(qythium) #1

Hi all,

Just sharing a little script that I wrote for fun last weekend - It automatically adds annotations to optional internalized parameters of components (inspired by default keyword arguments in Python and the Bifocals plugin :snake::eyeglasses: )

Over the past few days I’ve come to find it rather useful, and it made me realise just how much time was spent before hovering over parameters for tooltips and creating little text panels over the place…

A few caveats:

  • The code loops through every input parameter of every component on the canvas and can get rather inefficient on larger files - the longest delay I’ve had was ~800ms on a definition with a few hundred components.
  • Only works on input params with a single value internalized, not floating params or inputs with multiple values.
  • The Python component has to be “refreshed” whenever a change is made - in the demo I’m connecting a timer to continually refresh it, but you wouldn’t want to do that in reality… just shove it in a corner and press F5 every once in a while.
  • Has to be disabled between toggling the “Draw Full Names” setting, otherwise the nicknames won’t be converted to full names and vice versa.

Trying out a different code-distribution method instead of attaching gh files: simply copy and paste the contents from this link into your own GhPython component:

Any comments and suggestions for improvement are welcome :slight_smile: