Custom Hooks
smartCollect offers hooks to trigger custom code on certain events as described in the following.
CRAGL_SMARTCOLLECT_ARCHIVE_FINISHED_HOOK
You can trigger custom code once an archive job has finished. For that, you can set the environment
variable CRAGL_SMARTCOLLECT_ARCHIVE_FINISHED_HOOK to point to a .py file. Once the archive
job finished, it will automatically trigger this module. The path is expected to contain a main
function with the following function signature:
def main(archive_path: str, nukescript_path: str) -> None:
# TODO: Add your code here.
That means, when this function gets triggered, you get information about the archive path (i.e. the absolute path where the archive was written to) and the nukescript_path (i.e. the absolute path of the .nk working file that got archived). You can react to these and do anything you like in this hook. For example, you can update your database, do any additional processing with the archive, write an email, shut down your computer, etc.