I need to run a script several times, which among other things adds a custom function to a handler list. How can I check that it doesn't eist already, so as not to have several identical functions in my handlers list, without clearing the list altogether?
This doesn't work.
import bpy
def test(self):
print('test')
if not test in bpy.app.handlers.render_pre:
bpy.app.handlers.render_pre.append(test)