Python - force SGTK to reload modules

You would put something like this at the top of the hook file:

You would post the `import message_helper
if "MODULES_PRELOADED" in os.environ:
    reload(the_module_I_want_to_reload)

os.environ["MODULES_PRELOADED"] = "1"

You could even store a list of modules you want to reload, and loop over them, and reload.

3 Likes