JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
557 stars 76 forks source link

How to use with multiple addons? #46

Closed NickGlenn closed 3 weeks ago

NickGlenn commented 5 years ago

I have a single repo/workspace that contains multiple Blender addons. When I run the "Build & Start" command it doesn't seem to load up any of them. Is there currently a way to use the extension for this scenario?

If not, a useful feature might be a workspace/project setting to manually declare entry points for addons. That way you could mount and load multiple addons or select which addon to mount when running "Build & Start".

JacquesLucke commented 5 years ago

Hm that is probably not supported currently. Are the addons in separate folders?

NickGlenn commented 5 years ago

Yes, they are currently in separate folders under a master addons/ folder. So the structure is...

addons/
  plugin_a/
    __init__.py
  plugin_b/
    __init__.py
  plugin_c/
    __init__.py
JacquesLucke commented 5 years ago

Does it work when you load these folders separately into vscode?

NickGlenn commented 5 years ago

Yes it does, and that's what I've been doing for the time being. Part of why it'd be nice to launch specific plugins from the root is that the documentation/site files for the plugins are in another folder at the top level (sibling to addons/), which means I need another window open for editing the site and documentation for the addons. Additionally, context switching between addons also means independent VSCode windows that I'd need to hop between.

I do realize that I'm likely in the minority of users with this pattern, but it might be a useful consideration for others who have mono repo projects or who manage related addons under an umbrella project.

Great work on this extension by the way!

JacquesLucke commented 5 years ago

Visual Studio Code supports multi-root-workspaces (https://code.visualstudio.com/docs/editor/multi-root-workspaces). With that, you do not need to have multiple instances running at the same time. The blender extension should be able to support that, never really tried though.

NickGlenn commented 5 years ago

I tried that approach as well. If only one addon is present in any of the listed folders for the workspace, it works. When an addon exists in more than one folder listed in the *.code-workspace, it fails to load any of them.

I'll try and do some more investigation into this issue later this week.

Griperis commented 3 years ago

Use folders settings in .code-workspace file as follows: { "folders": [ { "path": "addon1" }, { "path": "addon2" }, ] ... }

All folders have to contain the __init__.py file, which is this extension looking for.