Noob Problem: Updates to imported modules not being recognised

Hi,

I have some simple scripts with one main ‘controller’ script. I have broken my code up for readability and import my modules as required in the usual Python good-practice style. All my modules are external files and as I test the code, I correct as required, save the script and restart the test.

I have not had a problem with this until v2.6.2. Now when I make a change in a module, the change is not recognised unless I close Blender and restart. Simply reloading my blend file without closing Blender totally first does not help. This is a REAL pain and is slowing me down.

What have I done wrong? Is there some configuration in user preferences I need to tweak? What changed?

Can you upload the .blend with the example?

That is just the way python works. If you have registered something, it remains in memory (bugs and all) until you unregister it or close/reopen Blender.

This is my workflow.
Create code.
Run code
If error, close Blender and re-open.
Make adjustments to code to correct the error.
Repeat…

I have found that I waste more time wondering if my new code is actually really running than the time it takes to just close/re-open Blender.

I don’t know if its clean and if it’s can help but with my moleculars physics script , in scene_exporter.py I did this:


...
import imp
import vmol
imp.reload(vmol)
...

Where “vmol” is a script (vmol.py) external to blender.
With “imp.reload(vmol)” I can modify my external script and run it again with the modification without restarting blender.

Let’s me know if it’s help you or somebodyelse or if its not clear enough.

(sorry , it’s difficult for me to type text, I write from my cellphone)

@Atom:
Good idea, just restarting. However, what is confusing me is that my scripts are not registered and I never experienced this problem before. My workflow has always been to edit, save, run, and so on.

@Pyroevil:
Also a good idea - I’ll try that sometime.

In the meantime, I have had another problem with this particular model and that is, I created it on a datastick. When I plug the datastick into another computer I get an error that drive ‘dr1’ (whatever that is) cannot be read. This error does not go away when clicking either continue or cancel. I gave up on the blend file and have rebuilt it on my ‘C’ drive with the intention of copying across as I need it. This seems to have fixed both problems.

another way i use most of the time

when i work to debug a script
i use the text editor to upload a py external file

but that file is already open with notepad2 so if i see a bug in text editor when i run it i can go back change it in notepad2 and save it then in text editor i simply reload it and run it again ect…

salutations