Giter VIP home page Giter VIP logo

blender_vscode's Introduction

Blender Development in VS Code

The only key combination you have to remember is ctrl+shift+P. All commands of this extension can be found by searching for Blender.

Installation

The extension is installed like any other extension in Visual Studio Code.

Addon Tools

How do I create a new addon?

Execute the Blender: New Addon operator and use the setup wizard. You will be asked for the following information:

  • Which addon template should be used?
  • Where should the addon be created? This should be an empty folder, preferably without spaces or special characters in the name.
  • What is the name of the addon?
  • What is your name?

How can I use the extension with my existing addon?

The extension only supports addons that have a folder structure. If your addon is a single .py file, you have to convert it first. To do this, move the file into a new empty folder and rename it to __init__.py.

To use the extension with your addon, just load the addon folder into Visual Studio Code. Then execute the Blender: Start command. This will ask you for a path to a Blender executable. Only Blender 2.8 is supported.

After you choose a path, Blender will open. The terminal output can be seen inside of VS Code. The first time you open a new Blender build like this can take a few seconds longer than usual because some Python libraries are installed automatically. For that it is important that you have an internet connection.

Once Blender is started, you can use the Addon in Blender. Debugging should work now.

If the selected Blender executable does not use its own Python version, no packages will be installed by default. This is to make sure that the extension does not interfere with another package manager. You can either install the modules listed in the error message manually, or allow the extension to install the modules itself. To do that, the blender.allowModifyExternalPython setting has to be checked in VS Code.

How can I reload my addon in Blender?

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, activate the blender.addon.reloadOnSave setting in VS Code.

Script Tools

When I say "script" I mean a piece of Python code that runs in Blender but is not an addon. Scripts are best to test and learn Blender's Python API but also to solve simple tasks at hand. Usually scripts are written in Blender's text editor. However, the text editor has fairly limited capabilities compared to modern text editors and IDEs.

For script writing this extension offers

  • all text editing features VS Code and its extensions can offer
  • a way to quickly organize your scripts into folders
  • easy execution of the script inside of Blender
  • a simple way to change the context, the script runs in
  • debugging

How can I create a new script?

Execute the Blender: New Script command. You will be asked for a folder to save the script and a script name. For quick tests you can also just use the given default name.

The new script file already contains a little bit of code to make it easier to get started.

How can I run the script in Blender?

First you have to start a Blender instance by executing the Blender: Start command. To execute the script in all Blender instances that have been started this way, execute the Blender: Run Script command.

How can I change the context the script runs in?

Currently the support for this is very basic, but still useful. To run the script in a specific area type in Blender insert a comment like #context.area: VIEW_3D. The preferred way to insert this comment is to execute the Blender: Set Script Context command.

Troubleshooting

  • Make sure you use the newest version of VS Code.
  • Use the latest Blender version from https://builder.blender.org/.
  • If your Blender does not use its own Python version, enable blender.allowModifyExternalPython or install the packages in the error message manually (currently debugpy, flask and requests are required).

Status

This extension is not actively developed anymore. However, if you are interested in working on this extension, please contact me.

blender_vscode's People

Contributors

acylsilane avatar cgartpython avatar chubei-oppen avatar dotbow avatar florianfelix avatar gaiaclary avatar griperis avatar jacqueslucke avatar jessey-git avatar mpreisler avatar needabetterusername avatar satabol avatar schlegel11 avatar twilson90 avatar zacheastin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blender_vscode's Issues

Non-deterministic registration order for scripts

This seems only to be an issue while developing with reloading (via auto_load.py). When the addon gets registered the normal way in the preferences it seems to always work.

When classes in a file get registered they seem not to be registered in any deterministic order.
The Problem occurs when Panels with "bl_parent_id" try to get registered but the parent panel is not registered yet.
When repeatedly saving the file (triggering a reload) sometimes it works which seems to suggest the registration order is somehow random. The subpanels also appear in random order inside the parent when it works.

Sample ui panels file:
https://gist.github.com/florianfelix/4cfdff72c4c3e4864384e42c19ab082a

Is there maybe already any way to force some kind of registration order on the classes?

Blender crashes - project load

There is a script test.py which only calls: bpy.ops.wm.open_mainfile(filepath=os.path.abspath("./myProject.blend"))

The evaluated file path is OK. While the call is being executed the following error happens:

Got GET: {'type': 'ping'}
127.0.0.1 - - [20/Dec/2019 07:23:45] "GET / HTTP/1.1" 200 -
Got POST: {'type': 'script', 'path': 'd:\\My Workspace\\test.py'}
127.0.0.1 - - [20/Dec/2019 07:23:45] "POST / HTTP/1.1" 200 -
Read blend: d:\My Workspace\myProject.blend
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFC8A91FB74
Module  : c:\Program Files\Blender Foundation\Blender 2.81\python37.dll
The terminal process terminated with exit code: 11

after which, the Blender process crashes and test.py becomes read-only.

If a script is executed using a shell like:
blender --background --python test.py
everything executes OK

Unable to import 'bpy' pylint(import-error)

Hello,
I get the error "Unable to import 'bpy' pylint(import-error) [1,1] for anything blender.

Note I'm running Blender 2.80.75, VSCode version 1.38.1, Python 3.7.4 64bit, on a Windows 10 OS, and the latest extensions for Blender Development and Linting, debugging (which Blender Development addon needs).

It also errors on any Blender code.

Any help would be greatly appreciated :)

VSCode pic enclosed.

BlendDevVSCode

The "Reload Addons" action sometimes does not execute

Essentially everything works fine but at some random point using the "Reload Addons" action will do nothing. Blender is still active at this point, as-is the actual debugger connection (can set breakpoints and have them be hit). The only way to get out of the state is to shutdown Blender and then use the "Start" action again.

I haven't been able to spot the exact pattern that triggers the issue but I'd be open to helping debug (I haven't found a good spot in the addon code to do additional tracing or checking etc)

Nothing is printed inside the Terminal pane -- usually when things work the first line printed is "Got GET: {'type': 'ping'}" but nothing will be printed when things stop working.

bpy.ops.wm.addon_enable changed to bpy.ops.preferences.addon_enable

Blender 2019-03-02 490a385c8124 API has changed bpy.ops.wm.addon_enable to bpy.ops.preferences.addon_enable.

Traceback (most recent call last):
File "C:\Users\Oleg.vscode\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py", line 32, in load
bpy.ops.wm.addon_enable(module=addon_path.name)
File "d:\Programs\Blender\2.8\blender-2.80.0-git.490a385c8124-windows64\2.80\scripts\modules\bpy\ops.py", line 200, in call
ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.wm.addon_enable" error, could not be found

Launching Blender via VS Code results in a crash

I have been using this extension since it was first announced and had zero problems with it (on Windows and Linux) until yesterday.

Starting yesterday, on Windows, Blender launches, but the app crashes after the following spew:

Executing task in folder TestMe: c:\Users\xyz\Desktop\test\blender-2.80.0-git.e80cbdac331a-windows64\blender.exe --python C:\Users\xyz.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\launch.py <

AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
found bundled python: c:\Users\xyz\Desktop\test\blender-2.80.0-git.e80cbdac331a-windows64\2.80\python
[{'load_dir': 'c:\Users\xyz\Desktop\test\TestMe', 'module_name': 'TestMe'}]

Collecting requests
Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests)
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
Using cached https://files.pythonhosted.org/packages/60/75/f692a584e85b7eaba0e03827b3d51f45f571c2e793dd731e598828d380aa/certifi-2019.3.9-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)
Using cached https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl
Installing collected packages: chardet, idna, certifi, urllib3, requests
Successfully installed certifi-2019.3.9 chardet-3.0.4 idna-2.8 requests-2.22.0 urllib3-1.25.3

WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\certifi already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\certifi-2019.3.9.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\chardet already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\chardet-3.0.4.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\idna already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\idna-2.8.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\requests already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\requests-2.22.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\urllib3 already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\urllib3-1.25.3.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\Users\xyz\AppData\Roaming\Python\Python37\site-packages\bin already exists. Specify --upgrade to force replacement.

################################################################################

could not install requests
################################################################################

Saved session recovery to 'C:\Users\xyz\AppData\Local\Temp\quit.blend'
The terminal process terminated with exit code: 1

I have tried manually upgrading all the packages listed, but it never seems to resolve the issue. I have uninstalled and reinstalled VS Code, all extensions, all versions of Python, etc. I can launch Blender just fine inside whatever build I make or download, but I cannot fully launch Blender VS Code using the Blender Development extension like I used to.

[WinError 183] Cannot create a file when that file already exists

I'm having the same issue that was previously discussed, but the solution was very vague or non-existent. I have no idea how to solve this. I receive the following error when trying to run "Blender: Start", which results in an instant crash of Blender. Blender loads for 2 seconds, then crashes.

Executing task in folder Blender: d:\Program Files\Blender Foundation\Blender\blender.exe --python C:\Users\efelder\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\launch.py 

Read prefs: C:\Users\efelder\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
found bundled python: d:\Program Files\Blender Foundation\Blender\2.80\python
archipack: ready
Traceback (most recent call last):
 File "d:\Program Files\Blender Foundation\Blender\2.80\scripts\modules\addon_utils.py", line 351, in enable
   mod = __import__(module_name)
ModuleNotFoundError: No module named 'Blender'
[{'load_dir': 'd:\\Program Files\\PythonProjects\\PythonProjects\\Blender', 'module_name': 'Blender'}, {'load_dir': 'd:\\Program Files\\PythonProjects\\PythonProjects\\TestAddon', 'module_name': 'TestAddon'}]
Traceback (most recent call last):
 File "C:\Users\efelder\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\launch.py", line 18, in <module>
   allow_modify_external_python=os.environ['ALLOW_MODIFY_EXTERNAL_PYTHON'] == "yes",
 File "C:\Users\efelder\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\include\blender_vscode\__init__.py", line 14, in startup
   path_mappings = load_addons.setup_addon_links(addons_to_load)
 File "C:\Users\efelder\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\include\blender_vscode\load_addons.py", line 20, in setup_addon_links
   create_link_in_user_addon_directory(source_path, load_path)
 File "C:\Users\efelder\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\include\blender_vscode\load_addons.py", line 43, in create_link_in_user_addon_directory
   _winapi.CreateJunction(str(directory), str(link_path))
FileExistsError: [WinError 183] Cannot create a file when that file already exists
Saved session recovery to 'C:\Users\efelder\AppData\Local\Temp\quit.blend' 

If the solution is to delete a file that already exist, well that's great. Which file and where??

blender executable not accepted

I'm trying to open launch blender within vscode but an error pops up telling me the path is not blender, is very weird as it didn't happen in my other computer with same software versions: windows 10, python 3.7, and latest versions of vscode and blender 2.80.

probleme

i create a new addon ( simple) name my name
i get select the folder
and here i get the error:Cannot create new addon in this folder.

How to use with multiple addons?

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".

AttributeError: Calling operator "bpy.ops.preferences.addon_enable" error, could not be found

Windows 10 1803 64 bit Blender 2.80 Beta 2019-01-11 23:51

Traceback (most recent call last):
File "C:\Users\BlenderViza.vscode\extensions\jacqueslucke.blender-development-0.0.11\pythonFiles\include\blender_vscode*load_addons.py*", line 32, in load
bpy.ops.preferences.addon_enable(module=addon_path.name)
File "e:\Armory\Armory_06beta_win64\2.80\scripts\modules\bpy\ops.py", line 200, in call
ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.preferences.addon_enable" error, could not be found
Sending: {'type': 'enableFailure', 'addonPath': 'c:\example\_Blender\AddOn\2.8\test'}
Armory: Proxy objects synchronized

I changed it back see issue #27 to

bpy.ops.wm.addon_enable(module=addon_path.name)

and then it works.

os.remove(link_path) unreliable

I had problems with os.remove(link_path):
File "C:\Users\BlenderViza.vscode\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py", line 39
=> PermissionError [WINERROR 5]

As administrator it deletes the targeted directory but not as user => unreliable!

My solution:
import shutil
shutil.rmtree(link_path)

Using symlinks to hook up the project to Blender is a VERY bad idea.

So I have been happily using the extension for a while, when I just encountered a big issue. After some development, I decided to write a script which bundles my addon as a .zip file which can be loaded in Blender. As I go to Preferences -> Addons in Blender, I notice by addon is still in there, probably from all my invocations of Ctrl+Shift+P -> Blender: Start. So I click Remove, so that I can then add it again using the .zip file. Then, due to what I can, in retrospective, only phrase as a stroke of SHEER LUCK, Blender gets a permission error trying to delete a file. I think "Huh? What's this?".

PermissionError: [WinError 5] Access is denied: 'C:\\Users\\Zyl\\AppData\\Roaming\\Blender Foundation\\Blender\\2.80\\scripts\\addons\\mouse_strafing\\.git\\objects\\1c\\36adfaa8701d66ad8189eb9868acda6ba8d801'

Wait... is that my git repository? I check the addon installation in the user addon folder, to find that all this time my addon has been hooked into Blender using a symbolic link, and I almost unknowingly deleted 2 weeks of work by the click of a button. WHAT. Luckily, only the project history (.git-folder) has been destroyed. Symlinking the entire development directory into production is probably the most mental thing I have come across this year. Please reconsider this design decision.

ValueError: register_class(...): already registered as a subclass

Hi

I cant make sense of the error below if it is my addon is borking or the Vscode addon is borking. I am just trying to start Blender to see if the addon is loaded properly.

I am on Windows 10 x64 using Py 3.7.0 (system installation)

It is the default template from the addon

class MYADDONOperator(bpy.types.Operator):
    bl_idname = "object.MYADDON"
    bl_label = "MYADDON"

    def execute(self, context):
        return {'FINISHED'}

        #self.report({'INFO'}, "Works")




def register():
    bpy.utils.register_class(MYADDONOperator)

def unregister():
    bpy.utils.register_class(MYADDONOperator)

> Executing task in folder MYADDON: C:\BLENDER_28\blender.exe --python T:\APPS\VSCODE\.vscode-oss\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\launch.py <

Read prefs: C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
found bundled python: C:\BLENDER_28\2.80\python
 * Serving Flask app "Blender Server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://127.0.0.1:7555/ (Press CTRL+C to quit)
Sending: {'type': 'setup', 'blenderPort': 7555, 'ptvsdPort': 6771, 'blenderPath': 'C:\\BLENDER_28\\blender.exe', 'scriptsFolder': 'C:\\BLENDER_28\\2.80\\scripts', 'addonPathMappings': [{'src': 'c:\\DEV\\DEV_Blender28_Python\\MYADDON', 'load': 'C:\\Users\\USER\\AppData\\Roaming\\Blender Foundation\\Blender\\2.80\\scripts\\addons\\MYADDON'}]}
Waiting for debug client.
Debug client attached.
Exception in module unregister(): 'C:\\Users\\USER\\AppData\\Roaming\\Blender Foundation\\Blender\\2.80\\scripts\\addons\\MYADDON\\__init__.py'
Traceback (most recent call last):
  File "C:\BLENDER_28\2.80\scripts\modules\addon_utils.py", line 313, in enable
    mod.unregister()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MYADDON\__init__.py", line 68, in unregister
    bpy.utils.register_class(MYADDONOperator)
ValueError: register_class(...): already registered as a subclass

Error: Traceback (most recent call last):
  File "C:\BLENDER_28\2.80\scripts\modules\addon_utils.py", line 313, in enable
    mod.unregister()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MYADDON\__init__.py", line 68, in unregister
    bpy.utils.register_class(MYADDONOperator)
ValueError: register_class(...): already registered as a subclass

Traceback (most recent call last):
  File "T:\APPS\VSCODE\.vscode-oss\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py", line 32, in load
    bpy.ops.wm.addon_enable(module=addon_path.name)
  File "C:\BLENDER_28\2.80\scripts\modules\bpy\ops.py", line 200, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
  File "C:\BLENDER_28\2.80\scripts\modules\addon_utils.py", line 313, in enable
    mod.unregister()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MYADDON\__init__.py", line 68, in unregister
    bpy.utils.register_class(MYADDONOperator)
ValueError: register_class(...): already registered as a subclass


Sending: {'type': 'enableFailure', 'addonPath': 'c:\\DEV\\DEV_Blender28_Python\\MYADDON'}

ModuleNotFoundError

I'm running blender 2.80 from docker like this:

#!/bin/sh
exec \
  docker run -t \
  -e ADDON_DIRECTORIES_TO_LOAD \
  -e EDITOR_PORT \
  -e ALLOW_MODIFY_EXTERNAL_PYTHON \
  -e DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v /home/radivarig/:/home/radivarig \
  --network="host" \
  --device /dev/snd \
  ubuntu/blender:version3 \
  ./home/radivarig/projects/blender-env/blender-2.80-4dd0a90f4213-linux-glibc224-x86_64/blender "$@" \

I select it as blender executable after running Blender: Start, blender does opens but throws:

File "/home/radivarig/projects/blender-env/blender-2.80-4dd0a90f4213-linux-glibc224-x86_64/2.80/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
ModuleNotFoundError: No module named 'TestAddon'

The addon symlink is created under '/root/.config/blender/2.80/scripts/addons' inside the docker container and when I reset to factory settings or open blender by hand enabling the addon does work.

Any ideas?

Getting weird error on Save with `reloadOnSave` - but reload works!

When I save my code, the changes are taken into account and I can use them from Blender. Yet I get the following errors in the VSCode output:

Sending: {'type': 'enableFailure', 'addonPath': 'd:\\Training\\blender\\JPsTestAddOn'}
Read blend: D:\Training\blender\waves\wave2.blend
Moved...
Got GET: {'type': 'ping'}
127.0.0.1 - - [15/Nov/2019 23:25:52] "GET / HTTP/1.1" 200 -
Got POST: {'type': 'reload', 'names': ['JPsTestAddOn']}
127.0.0.1 - - [15/Nov/2019 23:25:53] "POST / HTTP/1.1" 200 -
addon_utils.disable: JPsTestAddOn not disabled
Exception in module register(): C:\Users\gygax\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\JPsTestAddOn\__init__.py
Traceback (most recent call last):
  File "d:\Program Files\Blender Foundation\Blender\2.80\scripts\modules\addon_utils.py", line 384, in enable
    mod.register()
  File "C:\Users\gygax\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\JPsTestAddOn\__init__.py", line 32, in register
    auto_load.register()
  File "C:\Users\gygax\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\JPsTestAddOn\auto_load.py", line 30, in register
    bpy.utils.register_class(cls)
TypeError: register() missing 2 required positional arguments: 'self' and 'context'

Error: Traceback (most recent call last):
  File "d:\Program Files\Blender Foundation\Blender\2.80\scripts\modules\addon_utils.py", line 384, in enable
    mod.register()
  File "C:\Users\gygax\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\JPsTestAddOn\__init__.py", line 32, in register
    auto_load.register()
  File "C:\Users\gygax\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\JPsTestAddOn\auto_load.py", line 30, in register
    bpy.utils.register_class(cls)
TypeError: register() missing 2 required positional arguments: 'self' and 'context'

Traceback (most recent call last):
  File "c:\Users\gygax\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\include\blender_vscode\operators\addon_update.py", line 27, in execute
    bpy.ops.preferences.addon_enable(module=self.module_name)
  File "d:\Program Files\Blender Foundation\Blender\2.80\scripts\modules\bpy\ops.py", line 201, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
  File "d:\Program Files\Blender Foundation\Blender\2.80\scripts\modules\addon_utils.py", line 384, in enable
    mod.register()
  File "C:\Users\gygax\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\JPsTestAddOn\__init__.py", line 32, in register
    auto_load.register()
  File "C:\Users\gygax\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\JPsTestAddOn\auto_load.py", line 30, in register
    bpy.utils.register_class(cls)
TypeError: register() missing 2 required positional arguments: 'self' and 'context'

Set Python Environment correctly?

Awesome plugin! Thank you!

I'm trying to set the Python env to Blender's bundled path, so all the Blender specific site-packages are available (i.e.- import bpy).

For example, if I try changing the VSCode Python Interpreter to the bundled Blender exe C:\Program Files\Blender Foundation\Blender 2.81\2.81\python\bin\python.exe, it doesn't stick in VSCode.

What am I missing?

Get "Path is not Blender." when choosing executable for "Blender: Start"

Just installed latest blender Beta (blender-2.80.0-git.84c06e996a7a-windows64), and then tried to run "Blender: Start" and point to the "blender.exe" and I get "Path is not Blender.". Is this related to the version of blender (since this Extension was built before the Beta release?) or something else?

Adding two features: header files and module installation

For my personal use I added two convenience functions to my fork:

  1. PIP-install of external modules to the bundled python.
  2. Installation of the python header files (sometimes need for 1).

This might be a bit off-topic with regards to the primary intention of this (very nice) extension, but if this sounds useful to anyone, I might be able to prepare a PR.
It is only tested on macOS yet, but works for 2.80, 2.81 and 2.82 on my rig.

Blender: Run Script - Exception Access Violation error

I have been trying to make the add-on running with the recent build (blender-2.80.0-git.030c7df19da9-windows64), but even when running just the "empty" script (created by the add-on) the command Blender: Run Script triggers an exception in Blender and shuts it down.

Blender: Start outputs:

> Executing task in folder openvr: d:\Dev\blender-2.80.0-git.0fd96b4128ff-windows64\blender.exe --python C:\Users\risa\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\launch.py <

Read prefs: C:\Users\risa\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
found bundled python: d:\Dev\blender-2.80.0-git.0fd96b4128ff-windows64\2.80\python
[]
 * Serving Flask app "Blender Server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://127.0.0.1:9448/ (Press CTRL+C to quit)
Sending: {'type': 'setup', 'blenderPort': 9448, 'ptvsdPort': 2120, 'blenderPath': 'd:\\Dev\\blender-2.80.0-git.0fd96b4128ff-windows64\\blender.exe', 'scriptsFolder': 'd:\\Dev\\blender-2.80.0-git.0fd96b4128ff-windows64\\2.80\\scripts', 'addonPathMappings': []}
Waiting for debug client.
Debug client attached.

following Blender: Run Script leads to:

Got GET: {'type': 'ping'}
127.0.0.1 - - [15/Jun/2019 12:53:11] "GET / HTTP/1.1" 200 -
Got POST: {'type': 'script', 'path': 'd:\\Work\\python\\test\\script 58e9321aae.py'}
127.0.0.1 - - [15/Jun/2019 12:53:11] "POST / HTTP/1.1" 200 -
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF67C1D8A90
Module  : d:\Dev\blender-2.80.0-git.0fd96b4128ff-windows64\blender.exe
The terminal process terminated with exit code: 11

The file script 58e9321aae.py is the default one:

import bpy
from mathutils import *
D = bpy.data
C = bpy.context

I saw it first on Blender version few days old, so I updated the fresh one today, but the error remains the same.

RuntimeError: Operator bpy.ops.wm.mouse_position.poll() Missing 'window' in context

I'm trying to learn blender python API using this example:

import bpy
from mathutils import *
D = bpy.data
C = bpy.context

class SimpleMouseOperator(bpy.types.Operator):
    """ This operator shows the mouse location,
        this string is used for the tooltip and API docs
    """
    bl_idname = "wm.mouse_position"
    bl_label = "Invoke Mouse Operator"

    x = bpy.props.IntProperty()
    y = bpy.props.IntProperty()

    def execute(self, context):
        # rather than printing, use the report function,
        # this way the message appears in the header,
        self.report({'INFO'}, "Mouse coords are %d %d" % (self.x, self.y))
        return {'FINISHED'}

    def invoke(self, context, event):
        self.x = event.mouse_x
        self.y = event.mouse_y
        return self.execute(context)

bpy.utils.register_class(SimpleMouseOperator)
bpy.ops.wm.mouse_position('INVOKE_DEFAULT')
bpy.ops.wm.mouse_position('EXEC_DEFAULT', x=20, y=66)

When I do "Blender: Run Script", I get this in the console:

Debug client attached.
Got GET: {'type': 'ping'}
Got POST: {'type': 'script', 'path': 'c:\\msys64\\home\\phan\\python\\new3\\mouse.py'}
Error: Traceback (most recent call last):
  File "C:\Users\phan\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\include\blender_vscode\operators\script_runner.py", line 16, in execute
    runpy.run_path(self.filepath, init_globals={"CTX" : ctx})
  File "c:\x\blender-2.80\2.80\python\lib\runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "c:\x\blender-2.80\2.80\python\lib\runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "c:\x\blender-2.80\2.80\python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\msys64\home\phan\python\new3\mouse.py", line 32, in <module>
    bpy.ops.wm.mouse_position('INVOKE_DEFAULT')
  File "c:\x\blender-2.80\2.80\scripts\modules\bpy\ops.py", line 198, in __call__
    ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Operator bpy.ops.wm.mouse_position.poll() Missing 'window' in context
location: c:\x\blender-2.80\2.8... truncated

Do you know what I did wrong?

Thank you.

Blender 2.79 support

I have a question about older Blender versions. Why only the 2.8 supported? Do you plan to port this to 2.79 as well? If not, why? Thanks!

looks super cool

I've always been interested in using blender as a cool way to teach programming, but the code->blender flow never worked well. I hope something like this can become standard practice, so bug the devs to add this to the official blender docs.

VSCode for Blender development

This extension is for addon development?
What about using VSCode to develop Blender C++/Python itself? Since VSCode could use CMake projects directly via this extension: https://github.com/microsoft/vscode-cmake-tools it looks that VSCode could be all in one solution for Blender development especially because it support all platforms that Blender runs on.

crash when reloading addon with popup is open

i don't think that this is a big problem but i thought ill report it anyways so when i create a popup like the one below and start blender trough vscode open the popup (important leave it open) and then reload the addon, click the ok button in the popup then blender crashes this behavior seems to pretty consistent.

import bpy

from cycles.ui import CYCLES_RENDER_PT_sampling, CYCLES_RENDER_PT_sampling_advanced
#from space_properties import PROPERTIES_PT_navigation_bar


class SM_Properties_Popup(bpy.types.Operator):
    bl_idname = 'sop.sm_properties_popup'
    bl_description = 'test'
    bl_label = 'Properties'

    bl_options = {'UNDO'}

    panels: dict = {}
    label: bool = True

    @classmethod
    def poll(cls, context): 
        return True #PROPERTIES_PT_navigation_bar.poll(context)


    def invoke(self, context, event):

        return context.window_manager.invoke_props_dialog(self, width=300)


    def execute(self, context):
        return {'FINISHED'}


    def draw(self, context):
        layout = self.layout


        #PROPERTIES_PT_navigation_bar.draw(self, context)

        CYCLES_RENDER_PT_sampling.draw(self, context)
        layout.label(text="Advanced")
        CYCLES_RENDER_PT_sampling_advanced.draw(self, context)

Problems with context

Hi

I have a script which works OK directly in Blender 2.80, but not from VSCode. The problems seem to be with the context, despite having used 'Blender:Set Script Context' = VIEW_3D. For example,

bpy.context.active_object returns None incorrectly and,

bpy.ops.object.modifier_apply gives RuntimeError: Error: Modifiers cannot be applied in edit mode despite being in Object mode.

Here is a test script which reproduces the problems

# context.area: VIEW_3D
import bpy
from mathutils import Vector

# make two icospheres and join them with Boolean union operator
# works directly from Blender 2.80 python editor
# fails running from VSCode using remote Blender Development plugin

# make new sphere object
bpy.ops.mesh.primitive_ico_sphere_add(location=Vector((0,0,0)), radius=1.0)
# get handle to object
ico1=bpy.context.active_object # PROBLEM - returns None
ico1=bpy.data.objects['Icosphere'] # get by name instead
# rename
ico1.name='Ico1'
ico1.data.name='Ico1'

# make new sphere object nearby
bpy.ops.mesh.primitive_ico_sphere_add(location=Vector((0.8,0,0)), radius=1.0)
# get handle to object
ico2=bpy.context.active_object # PROBLEM - returns None
ico2=bpy.data.objects['Icosphere'] # get by name instead
# rename
ico2.name='Ico2'
ico2.data.name='Ico2'

# join ico2 to ico1 by applying Boolean op
bool_mod=ico1.modifiers.new(name='bool_mod', type='BOOLEAN')
bool_mod.object=ico2
bool_mod.operation='UNION'
bpy.ops.object.modifier_apply(
	{"object": ico1},
	apply_as='DATA',
	modifier=bool_mod.name)

# but this gives ERROR - RuntimeError: Error: Modifiers cannot be applied in edit mode

Permission Error access Denied

Im running into a issue with opening up an addon im upgrading. I run blender run and it wont run in blender even when I run VS code as admin. Here is my log.

Executing task: c:\Users\fp\Downloads\blender-2.80-ea33b90a1bf-win64\blender-2.80.0-git.ea33b90a1bf-windows64\blender.exe --python C:\Users\fp.vscode\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\launch.py <

found bundled python: c:\Users\fp\Downloads\blender-2.80-ea33b90a1bf-win64\blender-2.80.0-git.ea33b90a1bf-windows64\2.80\python
Traceback (most recent call last):
File "C:\Users\fp.vscode\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\launch.py", line 16, in
allow_modify_external_python=os.environ['ALLOW_MODIFY_EXTERNAL_PYTHON'] == "yes",
File "C:\Users\fp.vscode\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode_init_.py", line 14, in startup
path_mappings = load_addons.setup_addon_links(addon_paths)
File "C:\Users\fp.vscode\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py", line 20, in setup_addon_links
create_link_in_user_addon_directory(source_path, load_path)
File "C:\Users\fp.vscode\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py", line 39, in create_link_in_user_addon_directory
os.remove(link_path)
PermissionError: [WinError 5] Access is denied: 'C:\Users\fp\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MB-Lab-master'
Saved session recovery to 'C:\Users\fp\AppData\Local\Temp\quit.blend'

It cant register , bpy_struct "Scene" registration error:

It seems like the Vscode addon has issues with registering this. If I start Blender the usuak way my addon loads and everything works, that is not the case when I run Blender with Blender:start

class ADDONPropertyGrp(PropertyGroup):
    testint = bpy.props.IntProperty(  
        name="testint",
        description="",
        default=1,
        min=1,
        )



registered like this

def register():
        bpy.types.Scene.ADDONPropertyGrp = bpy.props.PointerProperty(
                                    type=ADDONPropertyGrp)

def unregister():
    
    del bpy.types.Scene.ADDONPropertyGrp

Traceback (most recent call last):
  File "C:\VSCODE\.vscode-oss\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py", line 32, in load
    bpy.ops.wm.addon_enable(module=addon_path.name)
  File "C:\BLENDER_28\2.80\scripts\modules\bpy\ops.py", line 200, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
  File "C:\BLENDER_28\2.80\scripts\modules\addon_utils.py", line 393, in enable
    mod.register()
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\ADDON\__init__.py", line 457, in register
    type=ADDONPropertyGrp)
ValueError: bpy_struct "Scene" registration error: ADDONPropertyGrp could not register

Blender:Start issues on Windows 10

When trying to start blender via VS Code I get the following error:

blender starts up but crashes after a few seconds:

Executing task: c:\Program Files\Blender Foundation\blender-2.80.0\blender.exe --python c:\Users\maybites.vscode\extensions\jacqueslucke.blender-development-0.0.11\pythonFiles\launch.py <

Read prefs: C:\Users\maybites\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
found bundled python: c:\Program Files\Blender Foundation\blender-2.80.0\2.80\python
c:\Program Files\Blender Foundation\blender-2.80.0\2.80\python\bin\python.EXE: No module named pip.main; 'pip' is a package and cannot be directly executed

################################################################################

could not install ptvsd
################################################################################

Saved session recovery to 'C:\Users\maybites\AppData\Local\Temp\quit.blend'
The terminal process terminated with exit code: 1

Debugger does not like "from . MODULE import *"

Hi

It seems like the debugger throws an exception if a module (from the script folder) imported like

"from . MYMODULE import *"

And throws an exception like this, when the debugger is is enabled after starting Blender

Exception has occurred: ModuleNotFoundError
No module named '__main__.MYMODULE'; '__main__' is not a package
  File "C:\DEV\MYADDON\__init__.py", line 41, in <module>
    from . MYMODULE import *

Please bear in mind that Blender runs this addon no problem and MYMODULE.py is really in "C:\DEV\MYADDON" which is where __init__.py is.

Script works in Blender but not from Vscode

Hi

I am writing a script that I will turn into an addon. When I run the script from Vscode I get bunch of errors. When load the exact same script in Blender text editor and run from there, it works perfectly. Does this sound like an Vscode issue based on the logs?

https://paste.debian.net/hidden/07afbae4/

I tried creating a script right from Vscode using the addon but I get "Cannot read property 'data' of undefined" so I just run the loaded script. It was working fine until I added obj exporting line to my code.

"Blender: New Addon" fails silently after "Choose Template" prompt is answered

When executing the "Blender: New Addon" tool, I answer the prompt "Choose Template", and the tool stops. I can't find any log, or debugging information.

I may have installation issues (3 different python distributions, including Blender), but the most important problem I'm experiencing is that I'm not finding troubleshooting information in VSCode, for this Addon.

command 'blender.start' not found

Everything was working fine until I opened a different addon folder and then switched back to my original addon folder.
Now this message (command 'whatever_the_command_is' not found) appears for every command that this extension has.
I tried reinstalling the extension and restarting vs code and my computer but that didn't help.

Add-on inside Blender not showing (features like "New Panel" )

Hi, I'm really new to writing addons for Blender and found this amazing addon for VS code. I had some trouble with getting blender to start up and it turned out that VS code didn't have acces to the "program" folder so I cpoied Blender to a folder inside "documents" and it worked!!

Yesterday I watched the video (this one) you(Jacques Luke) did on the addon. it shows inside blender a addon that writes panels to VS code. I was immediate excited to use this feature but when I started blender it didn't show up.

So maybe someone knows why the addon inside blender isn't showing up? and how I can solve it so I can use this great addon for coding?(I hope I'm asking the right questions)

Visual Studio Code?

OK, well this isn’t really a bug ,but more of a question. Does the installation version of Visual Studio Code matter. I see there is User Installer, System Installer and .zip. I’m not sure which of those I should do. Never even heard of a “User Installer” before.


https://code.visualstudio.com/

Unable to execute Blender: Start on OSX

Unable to open on OSX

added this to resolve the issue in blender_executable.ts

on OSX blender is packaged in a .app folder-structure which the file-selector on osx recognises as an application. but when starting from commandline, the actual binary should be executed from the folder Contents/MacOS/ inside the blender.app (folder).

Another solution would be to use the 'open' command on osx.

L#4 import * as os from 'os';`
...
L#147     (askUser_BlenderPath)
if (os.platform() === 'darwin') {
     filepath = filepath + '/Contents/MacOS/blender';
}

heh, I started a forked a while back with some tweaks to the overall layout of the vscode plugin, but now I see you´ve implemented a similar solution in the new update :)

Autocompletion not working

Hi..
the extension can't recognize bpy module (neither the other blender's python API ones). So autocompletion feature is not working. What is the work around to fix that? tks

FileExistsError: [WinError 183] Cannot create a file when that file already exists

Hi

I am not sure why I am having this error, after needing to change the name of the addon folder. I removed the folder from Vscode and then added the new folder

I used to work. I am using it on Windows 10 x64, Py 3.7.0

Executing task in folder ADDON: C:\BLENDER_28\blender.exe --python C:\DRIVE\DRIVE_APP_SETTINGS\VSCODE\.vscode-oss\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\launch.py <

Read prefs: C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
found bundled python: C:\BLENDER_28\2.80\python
Traceback (most recent call last):
  File "C:\BLENDER_28\2.80\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
ModuleNotFoundError: No module named 'ADDON'
Traceback (most recent call last):
  File "C:\DRIVE\DRIVE_APP_SETTINGS\VSCODE\.vscode-oss\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\launch.py", line 16, in <module>
    allow_modify_external_python=os.environ['ALLOW_MODIFY_EXTERNAL_PYTHON'] == "yes",
  File "C:\DRIVE\DRIVE_APP_SETTINGS\VSCODE\.vscode-oss\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\__init__.py", line 14, in startup
    path_mappings = load_addons.setup_addon_links(addon_paths)
  File "C:\DRIVE\DRIVE_APP_SETTINGS\VSCODE\.vscode-oss\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py",
line 20, in setup_addon_links
    create_link_in_user_addon_directory(source_path, load_path)
  File "C:\DRIVE\DRIVE_APP_SETTINGS\VSCODE\.vscode-oss\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py",
line 43, in create_link_in_user_addon_directory
    _winapi.CreateJunction(str(directory), str(link_path))
FileExistsError: [WinError 183] Cannot create a file when that file already exists
Saved session recovery to 'C:\Users\USER\AppData\Local\Temp\quit.blend'

Terminal will be reused by tasks, press any key to close it.

Error: command 'b3ddev.startBlender' not

Hi

I am tryingto use this extension on Windows 10 x64 and this is an error I get when I try to start blender inside Vscode. I set the path for Blender exe

The addon is installed and enabled

Blender Development jacqueslucke.blender-development Jacques Lucke Tools to simplify Blender development. Disable Uninstall Details Contributions Dependencies

Error: command 'b3ddev.startBlender' not found at t._tryExecuteCommand (workbench.main.js:3041) at workbench.main.js:3041 at <anonymous> t.onDidNotificationChange @ workbench.main.js:2429 (anonymous) @ workbench.main.js:2429 e.fire @ workbench.main.js:183 t.notify @ workbench.main.js:2484 t.error @ workbench.main.js:3530 t.onError @ workbench.main.js:3027 (anonymous) @ workbench.main.js:3027 Promise rejected (async) (anonymous) @ workbench.main.js:3027 setTimeout (async) t.runAction @ workbench.main.js:3026 t.run @ workbench.main.js:3026 e.run @ workbench.main.js:983 t.elementSelected @ workbench.main.js:1046 (anonymous) @ workbench.main.js:1040

thanks

Upgrade to version 2.0.0 to run the task: blender: blender

Hi

I was trying to set this up on my other Win10 system and I am getting this error. I cant find what the issue is, since I do not have tasks.json file in the folder.

The task system is configured for version 0.1.0 (see tasks.json file), which can only execute custom tasks. Upgrade to version 2.0.0 to run the task: blender: blender```

Need skipfiles support.

I work on and maintain a lot of addons for my studio, and the constant exceptions being raised by space_toolsystem_common.py make it really difficult to use the debugger in VSCode. One could argue that this is a bug in Blender- but honestly I should be able to use vscode's built in skipfiles configuration capabilities to just skip space_toolsystem_common.py entirely. Unfortunately this extension seems to bypass the default vscode configuration somehow, so skipfiles is ignored.

To see what I'm talking about, enable breakpoints on any raised exception then run Blender. The breakpoints are non-stop.

The "Blender: Reload Addon" action causes an access violation with recent version of Blender

Starting with the bug here in case this addon is hooking into something it's not supposed to now?

Steps:

  • Start with default blender scene with an addon running in vscode.
  • Execute the "Blender: Reload Addons" operation

Git bisect blames the following commit: bbaa1bffe9dbc35d2791b83d0014ccb4ffb6087a

The AV looks like:

Exception thrown: read access violation.
scene was nullptr.

blender.exe!BKE_view_layer_default_view(const Scene * scene) Line 107	C
blender.exe!CTX_data_view_layer(const bContext * C) Line 1011	C
blender.exe!rna_Context_view_layer_get(PointerRNA * ptr) Line 155	C
blender.exe!Context_view_layer_get(PointerRNA * ptr) Line 160	C
blender.exe!RNA_property_pointer_get(PointerRNA * ptr, PropertyRNA * prop) Line 3723	C
blender.exe!pyrna_prop_to_py(PointerRNA * ptr, PropertyRNA * prop) Line 1538	C
blender.exe!pyrna_struct_getattro(BPy_StructRNA * self, _object * pyname) Line 4220	C
[External Code]	
blender.exe!py_timer_execute(unsigned __int64 UNUSED_uuid, void * user_data) Line 67	C
blender.exe!execute_functions_if_necessary() Line 121	C
blender.exe!BLI_timer_execute(...) Line 147	C
blender.exe!wm_event_do_notifiers(bContext * C) Line 416	C
blender.exe!WM_main(bContext * C) Line 423	C
blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 502	C

Attaching / debugging doesn't work

I can see the console logs inside VS Code and when I close Bledner the tasked in VScode in being closed too, so they are connected. Breakpoints don't work though

I have no clue what is causing this, because I know it worked at some point.
Currently I have my project opened in VSCode and the folder with add-on is linked inside my current blender versions script folder via a junction.
I'm running Windows 10 1903, the latest version of your add-on, vs-code and the newest build bot build of blender.

Debugging not working when non ascii characters in addon path

Hello,

I tried to debug an addon and it did not work. Debugging session was launching but threads never stopped on breakpoints. The addon was correctly updated.

Finally I renamed a part of the path that contained a character with an accent (é) !

Don't know if this is a limitation of your extension or the python extension itself.

Keep the good work what you do with this extension is incredible.

Attach to Running Blender Process

Hi @JacquesLucke,

first of all, great addon. Love it :) Been wanting something similar for some time now but unfortunately I've lacked the know-how to do it myself so far. I'm only getting started with Blender coding and being able to do so via VS Code is great. (Really looking forward to the code completion feature. =) )

I have a feature request: It would be great to attach the Plugin to an already running Blender process instead of having to start Blender through VS Code all the time.

Cheers
Michael

Error: Cannot read property 'data' of undefined

I get the error "Cannot read property 'data' of undefined" when attempting to launch Blender 2.8 (201901-07 00:16) on Windows 10 using the Ctrl+Shift+P: blender:start. I get the same error no matter what addon code/project I have loaded. The one shown in the attached image is the bundled MeasureIt addon by Antonio Vazquez.

When prompted for the Blender executable path, I've tried with/without quotes and other iterations with no effect. The path where I've got my 2.8 is:
C:\Users\WaschDL\Apps\blender-2.80.0-git.96f762500ef9-windows64\blender.exe

Latest VS-Code version. C/C++ and ms-python dependencies are installed.

Thanks!

vsc error launching blender 2 8

Failed to install with Visual Studio 2017

Hi.

Seems like, this extension is great to develop a new node with native C/C++ code and then I am trying to use it.

I'd like to stay with Visual Studio 2017 community because it is free and no request about license instead of the latest 2019 version.

so, can you update the installer to support VS2017 ? or upload it to market place for VS2017 ?

I guess current version can support only VS2019 because I can't directly install it via Visual Studio Market place following the introduction video then I have downloaded the installer, but it doesn't work with error as following :

8/23/2019 1:48:14 AM - Searching for applicable products...
8/23/2019 1:48:14 AM - Found installed product - Global Location
8/23/2019 1:48:14 AM - Found installed product - Visual Studio Community 2017
8/23/2019 1:48:14 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable1& skuData) at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported) at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported) at VSIXInstaller.App.Initialize(Boolean isRepairSupported) at VSIXInstaller.App.Initialize() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Blender: Start - cannot select Blender executable (Linux)

Hello,

I cannot select the Blender Executable, when I select "Blender: Start" from the prompt, the requester that appears does not allow me to move on the file system, and the Blender I have in my path is not shown.

I am on Linux (KUbuntu 18.04) with the latest stable VSCode and latest Blender 2.80 beta

I have attached a small mp4 video showing exactly what happens on my machine.

blender-vscode.zip

Use bl_label for folder linking

Hi

It would be very nice if the Vscode addon actually uses the bl_label to make the symbolic links in the Blender addon folder. At the moment it is using the folder name, and the folder names can be artbitrary or wrong during development. Obviously it would be nice if they match from the get go but that does not always happen depending on the situationm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.