JacquesLucke / blender_vscode

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

"Only 2.8 is supported" means 2.80? I am using 2.82a, and it crashes. #72

Closed HubKing closed 4 years ago

HubKing commented 4 years ago

It launched Blender in debug mode correctly, but when I tried to run a script, Blender hanged for about a minute or so (with 50% CPU usage) and then it crashed with an output below. The script itself does not have a problem; it has only a few lines of code to add some primitives and the same code worked when I directly ran it in Blender's script editor.

 * 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
Sending: {'type': 'setup', 'blenderPort': 9891, 'ptvsdPort': 4542, 'blenderPath': 'c:\\Program Files\\Blender Foundation\\Blender 2.82\\blender.exe', 'scriptsFolder': 'c:\\Program Files\\Blender Foundation\\Blender 2.82\\2.82\\scripts', 'addonPathMappings': []}
Waiting for debug client.
Debug client attached.
Got GET: {'type': 'ping'}
Got POST: {'type': 'script', 'path': 'c:\\Users...test.py'}
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF6D3C69D4A
Module  : c:\Program Files\Blender Foundation\Blender 2.82\blender.exe
The terminal process terminated with exit code: 11
JacquesLucke commented 4 years ago

Unfortunately, this is a known and annoying limitation. I'm working on it... See https://developer.blender.org/D7812.

HubKing commented 4 years ago

Thanks. Meanwhile, it maybe reduce confusion if you change "only 2.8" to "only 2.80", because I thought "2.8" could mean "2.8X" including 2.82a, the latest version.

JacquesLucke commented 4 years ago

The issue also exists in older Blender versions. It's mostly related to using the context in the script.

HubKing commented 4 years ago

For anyone who sees this later, the hang part was my mistake. The script added 10 primitive_ico_sphere_add, but after having tested it in Blender's editor with subdivisions=2, I had changed it into subdivisions=10 because 2 looked ugly. I don't now about other people's computer, but on my computer Blender shows delay whensubdivisions=8 and hangs with 10, even when I run the script right in its editor. Seems like increasing subdivisions exponentially consumes more memory.

When I changed it to 2, and ran the code in VS Code, Blender immediately crashed with the same output.