You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,53 @@ At this point you should be able to add a breakpoint and when you trigger it in
106
106
107
107
Note though that if you make changes to the file, Blender will not detect them. Have open `User Preferences > Addons` so you can toggle your addon on and off when you make changes. If anyone knows any way to improve this I'd love to know.
108
108
109
+
## Advanced Usage
110
+
111
+
### Wait for Client
112
+
113
+
The debugger can be made to wait for a client to connect (this will pause all execution). This can be useful for debugging the connection or when running blender headless / in background mode.
114
+
115
+
To do so, call the server connect command from the python console or from a script/addon like so:
First make sure the addon is installed, enabled, and works when you run blender normally.
124
+
125
+
Blender can then be run in background mode with the `-b/--background` switch (e.g. `blender --background`, `blender --background --python your_script.py`).
126
+
127
+
See [Blender Command Line](https://docs.blender.org/manual/en/latest/advanced/command_line/introduction.html).
128
+
129
+
You can detect when blender is run in background/headless mode and make the debugger pause and wait for a connection in your script/addon:
This will wait for a connection to be made to the debugging server. Once this is established, the script will continue executing and VSCode should pause on breakpoints that have been triggered.
137
+
138
+
For addons, you will need to do this from a handler:
0 commit comments