Custom inline functions?

Maybe a dumb question, but I can’t find this info anywhere…

Is it possible to define my own custom python functions that I can then use when writing inline expressions in the parameter window?

For example I want to do something like this:

op('myFuncs').mySpecialFunction('foo', 2)

Where ‘myFuncs’ is a Text DAT or something.

You can either use extensions for this. Or instead of op(), use mod(), which will return the module of that Text DAT. That’ll allow you to call functions as you typed.

Yes, what Malcolm said. Another way to do the same thing is op(‘myFuncs’).module.mySpecialFunction…

where myFuncs is a DAT containing your function.

@malcolm @Ivan
Perfect! Exactly what I needed. Thanks!

FWIW:

Extensions are the most organized and “touch-like” way to add Python functionality. Accessing them using ext.ExtensionName searches upwards through the network hierarchy, so you can build Python functionality at the top level of your project by adding an extension to your highest component. Similarly, you can add Python functionality to individual custom components by adding extensions at that level.

Working directly in DATs can be a quick and dirty fix or testing technique, but for polished projects I highly recommend using extensions.