AlansCodeLog / blender-debugger-for-vscode

Blender addon for remote debugging Blender with VS Code (and Visual Studio)
GNU General Public License v3.0
302 stars 36 forks source link

Feature Request: Auto Reload #12

Open Dene33 opened 5 years ago

Dene33 commented 5 years ago

Is there a live update functionality for this add-on? So after changing something in VSCode, changes also appear in Blender?

As I can see, there is no such a functionality. But reloading add-ons by hand are kinda awkward. Could you please add something like that?

As stated on github page of add-on for 2.8:

Execute the Blender: Reload Addons command. For that to work, Blender has to be started using the extension. Your addon does not need to support reloading itself. It only has to have correct register and unregister methods.

To reload the addon every time a file is saved, active the blender.addon.reloadOnSave setting in VS Code.

Something similar to reloadOnSave in VS would be really nice feature for this add-on. Hope to see that implemented, because this add-on is a must for developing in 2.79. Thank you!

AlansCodeLog commented 5 years ago

No, I will add it to the list of features to try and add when I have time (~ january), see #11. The thing is, if done from the Blender's side (aka my addon), you would have to tell it which addon to reload. With the blender_vscode extension, since it does it from VS Code's side, it knows what addon is open.

I will at the very least be adding an operator (which you can set to a shortcut) to easily reload an addon, but you would have to specify the name in the shortcut editor.

Another option might be to have it open a dropdown list of addons, then have a different hotkey for reloading the last selected from that dropdown.

I'm open to suggestions.

Note though that the extension is not really doing a live update, or at least, live update conveys to me "hot reload", and it's not doing that even though it might seem like it in the video because he's using a panel. It's doing a regular reload. Just want to clarify that. Don't want anyone getting confused.

Dene33 commented 5 years ago

Thanks for clarifying all the stuff. Reload add-on with shortcut is kinda alright, but not the best way, because one needs to push button every time add-on is changed. So there is no way of automate it at the end? Any workarounds maybe? Anyway, thank you for this extension, I'll check it back in January.

AlansCodeLog commented 5 years ago

Sorry I wasn't clear. I meant at the very least I would add that. It should be possible to monitor a folder for file changes. The thing is you would still have to specify manually which addon to monitor.

Say you're developing two addons, A and B. You go to develop A, you specify to watch for changes for A (just by name, since it should be possible to get it's location from blender), but if you then switch to developing B, you would have to change it. Does that make sense?

The way the VS Code extension seems to work is it queries VS Code for open folders, then sends a message to blender to reload the corresponding extension/s. From blender, I would have no way of knowing which extension/s you're working on.

Another idea might be to provide a checklist of extensions, then you check which you want to watch and reload on changes...