This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Debugging process for python addon (to blender)

Tags: python, kdevelop, debugging python, kdevelop, debugging python, kdevelop, debugging
(comma "," separated)
mluisser
Registered Member
Posts
6
Karma
0
A bit of background: So here I am trying to transition from simple python coding to a more complex python project that requires an IDE. I'd like to use kdevelop (vi mode yeah! :D ) but I cannot figure out the debugging process. So far I got along using print statements end error messages, so I don't have much experience with debugging python either (though I do know the workflow from other programming languages).

The situation: I want to work on a python project, an addon to blender (https://www.blender.org/). I created the project in kdevelop and manage to run the project (under linux) by calling the blender executable with the project as command line parameter (
Code: Select all
/usr/bin/blender -P /path/to/project/__init__.py
. However I'm completely lost on how to start to debug this. I'd like to be able to set breakpoints, watch variables etc.

I tried to research the topic, but I'm pretty confused, as there seem to be quite different approach in various IDEs (attaching to a python debug server (?), executing debug code in the project code, ...). I'd love to use kdevelop over any of the other IDEs that I tried so far, but this got me stuck. I'd be grateful if somebody could point me in the right direction!
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
I'm not sure we support debugging in this case at all. Is there a way to have a "normal" python script, extecuted by the python interpreter, instead of running it through blender -P? Has been a while since I worked with blender's python API ... ;)


I'm working on the KDevelop IDE.
mluisser
Registered Member
Posts
6
Karma
0
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
This method:
https://wiki.blender.org/index.php/User ... AsPyModule
*should* work. The others won't, sorry. We don't support remote debugging for python scripts at the moment.


I'm working on the KDevelop IDE.
mluisser
Registered Member
Posts
6
Karma
0
:'( pity

Anyway, thanks for looking into it, scummos! Saved me some time trying to get something running, that won't :)


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]