JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
572 stars 75 forks source link

Blender: Start creates copy of add-on when running in Blender 4.2 #168

Closed Dangry98 closed 2 months ago

Dangry98 commented 3 months ago

Running Blender:Start will make a copy of the add-on, meaning two add-on are run at the same time. The orginal addon is inside blender_org, a copy will be added to user_default. If the add-on is in the user_default from the start Blender crashes, so its seems it only works in blender_org, but then a copy is created.

image image

Mateusz-Grzelinski commented 2 months ago

Hi just a quick reply: where are you doing your add-on development? If I remember correctly this extension will do a hard link (in windows links are a bit weird) of your add-on to blender directory for add-ons. So if you are developing your add-on in blender add-on folder, this extension might create a duplicate but I would need to check deeper.

Dangry98 commented 2 months ago

@Mateusz-Grzelinski Hi, I am currently working in the blender_org folder, the reson is that if I try to do it in user_default and the start up Blender with VS Code it just crashes on all of the add-on I tried to far.

What is the current recommended way to work?

Mateusz-Grzelinski commented 2 months ago

your duplicate addon might be coming from

When if you start bledner from VS code VS code will make sure that blender can see the addon by making a hard link to scripts/addons/<addon name>. When you can see the duplicate of addon, what is the path reported? image

Dangry98 commented 2 months ago

Here is the paths: image

Dangry98 commented 2 months ago

your duplicate addon might be coming from

Scripts Directories user setting https://docs.blender.org/manual/en/latest/advanced/extensions/addons.html#user-defined-add-on-path you are working in directory that is already loaded to blender by default https://docs.blender.org/manual/en/latest/advanced/blender_directory_layout.html#blender-directory-path-layout

I have never used them to load any add-ons, so thats probely not the problem

Mateusz-Grzelinski commented 2 months ago

oh, I am not used to new extension system, i just found the path you are talking about. This is the second case that I was talking about. You are working in directory that is already loaded to blender by default. No, you need to have your addon outside of blender managed directory (however is is called). For example I have it like this: image

Mateusz-Grzelinski commented 2 months ago

if you are using addon the VS code will setup your addon in scripts/addons and if you are using new extension you addon will be setup in user_default.

Dangry98 commented 2 months ago

Oh! Thank you so much! It seems to be working! I did not know that it was possible to run from an external folder! Thats so nice!

The only problem I see with this metod is that it's slightly less convenient since I usually work and do iterations quite often, and then send over my Blender config folder to another computer. Then it's quite nice if the add-on is placed directly in the Blender config files to begin with. But thats a nit pick. Anyway, thanks for the help! I appreciate it!

Mateusz-Grzelinski commented 2 months ago

on linux I would recommend to copy with option to follow the links. But maybe we can also fix it in code. Will see. Made a draft with fix.

Dangry98 commented 2 months ago

Awsome! Thank you so much!

Mateusz-Grzelinski commented 2 months ago

Completed by mistake. It is worked on in #172

Dangry98 commented 2 months ago

Thank you so mutch @Mateusz-Grzelinski for working on this patch! 🥳 🚀 I really appreciated it! 🎊

How long does it take usually take before the Extension gets updated on VsCode?

Mateusz-Grzelinski commented 2 months ago

No idea. I mean if we ask Jack nicely he will release it for us relatively quickly, the bigger issue is how many bugs did I introduce... :) Because I have been working a lot on this repo I have set for myself this non formal milestone for next release. https://github.com/JacquesLucke/blender_vscode/milestone/1

Dangry98 commented 2 months ago

No idea. I mean if we ask Jack nicely he will release it for us relatively quickly, the bigger issue is how many bugs did I introduce... :) Because I have been working a lot on this repo I have set for myself this non formal milestone for next release. https://github.com/JacquesLucke/blender_vscode/milestone/1

Alright then, thanks for the answere :)