I am new to Blender and Python and was trying to follow a tutorial in the book Blender 2.49 Scripting by Michel Anders. I was trying to write a script that would create a user interface where the user could select various aspect of an insect and the code would create a polygonal bug. However, when I copied code exactly from the book, I got an error saying “‘return’ outside function”. Here is the code I had in the text editor:
#!BPY import Blender import mymesh2 Draw = Blender.Draw THORAXSEGMENTS = Draw.Create(3) TAILSEGMENTS = Draw.Create(5) LEGSEGMENTS = Draw.Create(2) WINGSEGMENTS = Draw.Create(2) EYESIZE = Draw.Create(1.0) TAILTAPER = Draw.Create(0.9) if not Draw.PupBlock('Add CreepyCrawly', [ ('Thorax segments:' , THORAXSEGMENTS, 2, 50, 'Number of thorax segments'),\ ('Tail segments:' , TAILSEGMENTS, 0, 50, 'Number of tail segments'),\ ('Leg segments:' , LEGSEGMENTS, 2, 10, 'Number of thorax segments with legs'),\ ('Wing segments:' , WINGSEGMENTS, 0, 10, 'Number of thorax segments with wings'),\ ('Eye size:' , EYESIZE, 0.1,10, 'Size of the eyes'),\ ('Tail taper:' , TAILTAPER, 0.1,10, Taper fraction of each tail segment'),]): return
Anybody know why I keep getting this error?
Thanks a lot