Unfortunately, you've run across one of the weakness of python - dynamic reloading/resourcing.
There are some workarounds - for instance, with the problem you're having, I'm assuming what's going on is you're doing something like this: >>> from myModule import myFunc *** make some changes to myModule.myFunc >>> reload(myModule) ...at which point, if you try to use myFunc, it hasn't been updated - the problem is the reference in the global namespace still points to the OLD version of the module, so you may be able to fix this by re-doing >>> from myModule import myFunc Unfortunately, this quickly gets pretty unmanagable if there is any sort of complexity to your dependency tree, since you'd have to go through and reload all the dependencies in reverse order, etc. I know I read once of somebody who implemented an "automatic-rewinding" reloader, that worked by overloading the import and keeping track of dependencies, but I never tried it myself, so I have no idea how well it worked. (I was scared it would just be a source of too many potential headaches / weird bugs). If you do try it, lemme know. But the short answer is... yeah, if you have any real complexity in either your dependencies, or in your import namespacing, it's generally easiest to restart. - Paul On Sun, Apr 12, 2009 at 6:43 AM, King <[email protected]> wrote: > > > The plugin I have created loads all the mel script and python scripts > at startup. All modules are imported using > "from myModule import *" syntax. In case if I do some changes in > python script and source again, maya crashes > badly. If I use "reload( myModule )" in script editor, it changes the > path to access functions. For example, now I have to use > "myModule.myFunction". The only solution is restart maya as far as > now. > > Is there any workaround for this problem? > > Prashant > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
