Thanks, the project is growin :)
Okay the callback itself is a simple function which receives the node name as argument. So a simple
def myCallback(nodeName):
print "mycallback"
Shoud work. You can define the callback whenever you want. In my plugins I call a initialize script from a c++ plugin during the load process of the plugin. Then in the initialize script I exectute the:
pm.callbacks(addCallback=myCallback, hook='AETemplateCustomContent', ...)
In the same scripts I register the AETemplates. Normally pymel finds the AETemplates automatically. The problem is that it only finds the very first AETemplates directory. So if you have more than only one AETemplate directory, they are not available. For this reason I load them manually.
The load procedure is located here - line 506:
https://github.com/haggi/OpenMaya/blob/master/src/mayaToCorona/mtco_devmodule/scripts/mtco_initialize.pyIn line 491 you can find the aeTemplateCallback. The callback simply calls the user AE template.