In this quick Blender 2.5 tip we show you a few examples of common bugs while scripting and show you how to fix them.
User Submitted Images
No images submitted yet
Discussion
14 Responses to “Tip: Script Bug Fixing 101”Leave a Comment
You must be logged in to post a comment.











This tutorial may not be about something “sexy” but definitely a necessary one. You have any recommendations on where the best place to go for help on scripts your working on? Isn’t there a Blender coders’s IRC chat?
#blendercoders and #blenderpython. Both at freenode.
If you’re looking for ‘long-term help’, like advice on the progress of an add-on, or a complicated script you’ll be working on for sometime, I’d suggest making a topic at BlenderArtists. If it’s just a small/ one-time question then you’d probably indeed want to go to IRC. The channel is #BlenderCoders on irc.feenode.net. =)
Good tutorial. Very useful for people new to scripting. Especially the tip on scopes with an explanation of the difference between self.myVar and myVar.
“If you’re getting errors than it’s probably better than not having any errors at all.”
Quoted for agreement. It’s horrible when your 1000+ lines script isn’t working, but isn’t giving errors either.
Thanks! Haha, yeah, throwing in a couple dozen prints just to know -where- the error is can get quite boring after the first few. =P
very interesting and well done. Thanks a lot!
Thanks Patrick. Very good tut, well explained.
thnx for yours awesome tips
Hi Patrick,
This was exactly what I was looking for, I just started python and was playing with blender and got that horrible message check the console for now..
. But now I know which console to use
Thanks
Bram
Thanks Patrick! Your tutorial was excellent! I learned a lot about Blender python plus your great debugging tips.
Could you do a tutorial about creating user interfaces with Blender python?
Hey Patrick, in the Blender Python console, it says “Convenience Imports: from mathutils import * ; from math import *
Does this mean those modules are already imported and does not need to import them?
Just curious.
Thanks
They aren’t imported already. It is just saying those are convenient modules that you may want to use. He had to import math in this example for the math.pi constant. Hope that helps. Happy blending/scripting!
Actually, those modules are imported, but only in the console. There’s also a difference in how they’re imported. The usual way in scripts is to use “import math”, so that you can then use “math.pi” for instance. In this case “from math import *” is used, which puts all members of math in the global namespace. What this means is that instead of “math.pi” you can use just “pi”.
Hello Patrick and thanks for that tips.
I was wondering, Is there no way to redirect the error output to the internal blender python console? I mean, can use something like the import sys and some sys.stderr = ?