I need to create a script to define certain math functions. This script will not directly modify or create any objects. I will simply use them with the XYZ Math surface and/or the Z Math surface. Among other functions, I need a sgn() function (why on Earth it isn't part of python I cannot fathom) and an a^b function that can handle non-integer b for negative a.
Creating these functions isn't a problem. I already have, for use with drivers, and I know I need to register them there by
bpy.app.driver_namespace['<functionname>'] = <functionname>
But how and where do I register them to be able to use them. My guess would be
bpy.app.foo['<functionname>'] = <functionname>
But what should I substitute for foo here?
This is simply amazing. I've googled for days about this, and the answer is nowhere to be found. Everything is about modifying meshes and creating classes to extend blender's functionality with new addons.. I have no need for that. I may at a later time, but I don't know. Is there really no way to implement a standalone mathematical function and register it in a way that it's available to all aspects of the program?