Ok,
I rarely post new threads about my problems as I usually look for answers on my own either through BA or google, but as it turns out scripting in blender 2.5 is turning out to be one heck of a challenge (especially as I’m new to it).
I was watching this video here :
And at around 17:00 he starts talking about editing the blender panels and how if you want to add one in you have to create a “test.py” file (where your blender.exe file is) and so I did, and then I wrote down the exact same script he did, and when I pressed F7, blender just crashed.
I’ll mention this right now I’m using this build:
At which point I figured I had typos in there which made the code compiling crash or something, so I looked through the script over and over and over again until I rooted out all the typos to come to the conclusion that even without any mistake blender crashed anyway.
So I remove the entire time function to leave just the part where text appears, still it crashed.
I’d just like (for now) to have a little panel that says “I’m a blenderhead”. That’s all I’m trying to achieve for now. And yet I can’t do it. Here’s my code (hopefully I haven’t made anything blatently stupid, at which point you,re lucky because you get to laugh at me ;)) :
import bpy
class ObjectButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW"
__context__ = "object"
class OBJECT_PT_blenderhead(ObjectButtonsPanel):
__idname__ = "OBJECT_PT_blenderhead"
__label__ = "Blenderhead"
def draw(self, context):
layout = self.layout
layout.itemL(text="I'm a blenderhead!")
bpy.types.register(OBJECT_PT_blenderhead)
If it’s not too much to ask, while you point out what I did wrong, could you please explain why it is wrong?
Thank you!
P.S: also is there a list somewhere of all the “functions”, not sure what to call them, to bring up the different GUI widgets such a check boxes, dropdown menus,… thank you