JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
540 stars 70 forks source link

Reloading imported modules in a script #158

Open ChristopherPAndrews opened 3 months ago

ChristopherPAndrews commented 3 months ago

I am working on a multi-file project I am running as a script. Everything works well when I make changes in the main file. I edit the file, run Blender:Run Script and it runs with no problems. However, if I make changes in any of the imported files they aren't seen until I restart Blender. Is there something I can do to force a reload of the imported code?

macduff111 commented 3 months ago

I use this in my scripts which imports first time it is run and reloads on subsequent runs

from importlib import reload
import blah
reload(blah)