diff --git a/pythonFiles/include/blender_vscode/__init__.py b/pythonFiles/include/blender_vscode/__init__.py index 286552a..35aeefc 100644 --- a/pythonFiles/include/blender_vscode/__init__.py +++ b/pythonFiles/include/blender_vscode/__init__.py @@ -1,7 +1,7 @@ import bpy import sys -def startup(editor_address, addons_to_load, allow_modify_external_python, justMyCode): +def startup(editor_address, addons_to_load, allow_modify_external_python): if bpy.app.version < (2, 80, 34): handle_fatal_error("Please use a newer version of Blender") @@ -14,7 +14,7 @@ def startup(editor_address, addons_to_load, allow_modify_external_python, justMy path_mappings = load_addons.setup_addon_links(addons_to_load) from . import communication - communication.setup(editor_address, path_mappings, justMyCode) + communication.setup(editor_address, path_mappings) load_addons.load(addons_to_load) diff --git a/pythonFiles/include/blender_vscode/communication.py b/pythonFiles/include/blender_vscode/communication.py index 4473f25..2ca9ca3 100644 --- a/pythonFiles/include/blender_vscode/communication.py +++ b/pythonFiles/include/blender_vscode/communication.py @@ -12,15 +12,13 @@ EDITOR_ADDRESS = None OWN_SERVER_PORT = None DEBUGPY_PORT = None -JUSTMYCODE = None -def setup(address, path_mappings, justMyCode): - global EDITOR_ADDRESS, OWN_SERVER_PORT, DEBUGPY_PORT, JUSTMYCODE +def setup(address, path_mappings): + global EDITOR_ADDRESS, OWN_SERVER_PORT, DEBUGPY_PORT EDITOR_ADDRESS = address OWN_SERVER_PORT = start_own_server() DEBUGPY_PORT = start_debug_server() - JUSTMYCODE = justMyCode send_connection_information(path_mappings) @@ -104,7 +102,6 @@ def send_connection_information(path_mappings): "type" : "setup", "blenderPort" : OWN_SERVER_PORT, "debugpyPort" : DEBUGPY_PORT, - "justMyCode": JUSTMYCODE, "blenderPath" : str(blender_path), "scriptsFolder" : str(scripts_folder), "addonPathMappings" : path_mappings diff --git a/pythonFiles/launch.py b/pythonFiles/launch.py index 85cc655..f658f26 100644 --- a/pythonFiles/launch.py +++ b/pythonFiles/launch.py @@ -16,7 +16,6 @@ addons_to_load=tuple(map(lambda x: (Path(x["load_dir"]), x["module_name"]), json.loads(os.environ['ADDONS_TO_LOAD']))), allow_modify_external_python=os.environ['ALLOW_MODIFY_EXTERNAL_PYTHON'] == "yes", - justMyCode=os.environ['JUSTMYCODE'] == "True", ) except Exception as e: if type(e) is not SystemExit: diff --git a/src/blender_executable.ts b/src/blender_executable.ts index 41f6edd..e94ff74 100644 --- a/src/blender_executable.ts +++ b/src/blender_executable.ts @@ -195,7 +195,6 @@ async function getBlenderLaunchEnv() { return { ADDONS_TO_LOAD: JSON.stringify(loadDirsWithNames), EDITOR_PORT: getServerPort().toString(), - JUSTMYCODE: config.get('addon.justMyCode') ? 'True' : 'False', ALLOW_MODIFY_EXTERNAL_PYTHON: config.get('allowModifyExternalPython') ? 'yes' : 'no', ...config.get("environmentVariables", {}), }; diff --git a/src/communication.ts b/src/communication.ts index fdcadd0..5f91961 100644 --- a/src/communication.ts +++ b/src/communication.ts @@ -1,6 +1,7 @@ import * as http from 'http'; import * as vscode from 'vscode'; import * as request from 'request'; +import { getConfig } from './utils'; import { attachPythonDebuggerToBlender } from './python_debugging'; const RESPONSIVE_LIMIT_MS = 1000; @@ -132,7 +133,9 @@ function SERVER_handleRequest(request: any, response: any) { switch (req.type) { case 'setup': { - let instance = new BlenderInstance(req.blenderPort, req.debugpyPort, req.justMyCode, req.blenderPath, req.scriptsFolder, req.addonPathMappings); + let config = getConfig(); + let justMyCode:boolean = config.get('addon.justMyCode') + let instance = new BlenderInstance(req.blenderPort, req.debugpyPort, justMyCode, req.blenderPath, req.scriptsFolder, req.addonPathMappings); instance.attachDebugger(); RunningBlenders.register(instance); response.end('OK');