JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
545 stars 74 forks source link

Problem with blender 2.93 #100

Closed IPv6 closed 3 years ago

IPv6 commented 3 years ago

I am using 0.015 and it works very well with 2.91. But there is a problem with 2.93 beta: when blender is up and running from inside addon, it can not compile external OSL scripts. This is only on windows, using the same setup (vscode+blender 2.93) on MacOs and everything is fine

I made a bug request initially in Blender bugtracker: https://developer.blender.org/T88323 Turns out the problem mainly exist when blender is started from inside VSCode, and not from command line. Concole output (when executing steps from blender issue tracker blend file):

> Executing task in folder wplabs-19: c:\_WPLabs\Programs\blender293\blender.exe --python c:\Users\WPLabs\.vscode\extensions\jacqueslucke.blender-development-0.0.15\pythonFiles\launch.py <

Read prefs: C:\Users\WPLabs\AppData\Roaming\Blender Foundation\Blender\2.93\config\userpref.blend
WPLStudio: registering panels
Config: initialization
WPLStudio: register done
[{'load_dir': 'c:\\_WPLabs\\BitBucket\\wplabs-19\\_project\\blender\\addons290\\', 'module_name': 'addons290'}]
* 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:6203/ (Press CTRL+C to quit)
Sending: {'type': 'setup', 'blenderPort': 6203, 'debugpyPort': 9329, 'blenderPath': 'c:\\_WPLabs\\Programs\\blender293\\blender.exe', 'scriptsFolder': 'c:\\_WPLabs\\Programs\\blender293\\2.93\\scripts', 'addonPathMappings': [{'src': 'c:\\_WPLabs\\BitBucket\\wplabs-19\\_project\\blender\\addons290', 'load': 'C:\\Users\\WPLabs\\AppData\\Roaming\\Blender Foundation\\Blender\\2.93\\scripts\\addons\\addons290'}]}     
Waiting for debug client.
Debug client attached.
WPLStudio: unregister done
WPLStudio: registering panels
Config: initialization
WPLStudio: register done
Read blend: C:\_WPLabs\Downloads\oslScriptFail.blend
ERROR: error: C:\_WPLabs\Downloads\oslScriptFail.osl:1:10: warning: non-portable path to file '"c\\_WPLabssProgramsmblender29322.932scriptsraddonsacycles\shader\stdcycles.hd'; specified path differs in case from file name on disk
#include "c:\\_WPLabs\\Programs\\blender293\\2.93\\scripts\\addons\\cycles\\shader\\stdcycles.h"
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        "c\\_WPLabssProgramsmblender29322.932scriptsraddonsacycles\shader\stdcycles.hd
Error: OSL script compilation failed, see console for errors

Seems like this addon replaces some paths that are used by OSL during compilation. When blender is started from inside vscode thereis a line " 'scriptsFolder': 'c:\_WPLabs\Programs\blender293\2.93\scripts' " and the error message gives '"c\_WPLabssProgramsmblender29322.932scriptsraddonsacycles\shader\stdcycles.hd' - slashes arise right after overloaded path... may be coincidense, but could it be the reason?

Does anyone had the same problem?

IPv6 commented 3 years ago

Answering my own question - seems to be path casing problems. current beta of blender (on windows) has problems (at least with OSL) IF path to executable has disk char in lower case. after changing path casing in addon settings - everything started to work again.

broken:     "blender.executables": [{"path": "c:\\_WPLabs\\Programs\\blender293\\blender.exe", ...
fixed:     "blender.executables": [{"path": "C:\\_WPLabs\\Programs\\blender293\\blender.exe", ...