2
$\begingroup$

I'm trying to use Visual Studio Code to develop Python Blender scripts, and I've run into an odd problem.

I already had Visual Studio Code installed (1.49.3) on my Windows 10 box, so I downloaded Blender (2.90.1) and the latest stable version of Python (3.9.0). I also installed Jacques Lucke's Blender Development extension.

I was able to connect Visual Studio Code to Blender. But when I ran the following test script:

import bpy
bpy.data.objects["Cube"].data.vertices[0].co.x += 2.0
bpy.ops.mesh.primitive_cube_add(location=(1, 0, 0))

Blender crashed, and I got the following error message:

Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF6091405F3
Module  : blender.exe
Thread  : 00002968
Writing: C:\Users\aschn\AppData\Local\Temp\blender.crash.txt
The terminal process "c:\Program Files\Blender Foundation\Blender 2.90\blender.exe '--python',
'c:\Users\aschn\.vscode\extensions\jacqueslucke.blender-development-0.0.12\pythonFiles\launch.py'"
terminated with exit code: 11.

However, the script works just fine when I run it directly in Blender (in its Scripting workspace).

So, I tried eliminating the line that creates a cube:

import bpy

bpy.data.objects["Cube"].data.vertices[0].co.x += 2.0

This script works fine from Visual Studio Code.

In short, from Visual Studio Code I can manipulate existing objects but I can't create a new one.

Any idea what's going on? I found a bunch of posts about the EXCEPTION_ACCESS_VIOLATION error, but the code that was causing the problem described in these posts was far more complex.

$\endgroup$
4
  • $\begingroup$ Hello, have you looked through the issues on the project github ? github.com/JacquesLucke/blender_vscode/issues $\endgroup$
    – Gorgious
    Oct 7 '20 at 6:41
  • $\begingroup$ I had looked for that particular error message and hadn’t seen it. $\endgroup$ Oct 7 '20 at 9:56
  • $\begingroup$ Have you authorized the application in your firewall or any other access-blocking device on your computer ? $\endgroup$
    – Gorgious
    Oct 7 '20 at 10:02
  • $\begingroup$ If it’s an access issue, then I shouldn’t be able to successfully modify an object, right? But just In case, I’ll try running VS Code in admin mode $\endgroup$ Oct 7 '20 at 10:11
1
$\begingroup$

I tried to apply a fix for a similar problem you described about the Exception Access Violation error.

The sequence to follow apparently is to go under the Advanced tab under Windows System Properties selection. Under Performance Options, there is a radio button selection to Turn on DEP for all programs and services except those I select:.

Upon adding Blender 2.90, The DEP prompt displays

You can not set DEP attributes on 64-bit executables".

I have a 64-bit Windows operating system, in which Blender 2.90 worked temporarily after adjusting the compatibility settings to Windows 8. Apparently a particular Microsoft update doesn't like the software.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.