![]() Though I appreciate that is not very pretty. I think the problem with your code is that due to scope, the loaded variable is reset when you run the Toolkit restart, so it is never True? The environment variables should survive the reload. _command("Show Starter Template App.", self.show_app) It was originally written for a project in which relatively untrustworthy. ![]() ![]() If "MESSAGE_HELPER_PRELOADED" in os.environ: This is a short example of how to (more or less) safely reload a python module. # Append path to message helper module location I just mocked up an example on my side, and whilst Toolkit won’t reload any modules that it didn’t import (I’m not actually a 100% on what the requirements are there), you should be able to reload them with a reload statement, but you would need to handle that your self. # when reloaded, loaded is defined as true, so reload your submodules:ĭo you know any way to force python / sgtk to reload all submodules without exiting maya? Right now, everytime I make a synta圎rror, it takes me several minutes juste to relaunch maya… # loaded is then defined in the exception block # First time the module imports, loaded is undefined and will trigger the exception. Module B is outside config folder, in a cross project directoryĪll init.py are setuped to reload submodules: I am using a decentralised setup (descriptor pointing to a folder on our sever) Even ‘Reload engine and apps’ in Maya Shotgun’s Work Area Info does not seem to do the trick. My problem is that SGTK does not seem to reload module B if I don’t completly close and restart maya.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |