blender_vscode
blender_vscode copied to clipboard
Support running `Blender: Run Script` with single button 🔥
This branch is continuation of #199 but with focus on Blender: Run Script
. Lets deal with 199 first, here I also made many changes.
- Improvements for
Blender: Run Script
:- When no Blender instances are running, run
Blender: Start
and then immediately runBlender: Run Script
- When Blender instances are running, just run the script on all available instances (old behavior)
- Specify default
Blender: Start
configuration in settings usingisBlenderRunScriptDefault
inblender.executables
- Run
Blender: Run Script
using single button by adding snippet tokeybindings.json
.
- When no Blender instances are running, run
{
"key": "ctrl+shift+enter",
"command": "blender.runScript",
"args": {
// optional, must be absolute path, defaults to current open file
"path": "E:\\BlenderProjects\\leagacy_and_extension\\i.py"
},
"when": "editorLangId == 'python'"
}
TODO:
- more testing needed, also on different platforms, especially different commands
- [x] when blender fails to start we need to clear registered callbacks
- [x] blender can be run with
launchDebug
: add identifier to debug config to know which instance to clean - [x] or
launch
: we can tracktask._id
to know when to clear callbacks usingtasks.onDidEndTaskProcess
- [x] blender can be run with
- [x] specify optional file to run
- [x]
RunningBlenders
might have invalidBlenderInstance
- actually they are never cleared