Scripting New Panels in 2.5

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

we asked that 2 weeks ago and got no answers at all

so your lucky to have found this piece!

can you explain where you load this thing?

i mean is it like before in a py file that you can upload in text editor then run alt-a

i hope or it wont be fun anymore !

thanks

Well in the video he just hovers over the buttons window and presses F7 and tadaa it appears. When I do the same, Blender just crashes.

the file has to be names test.py and be located in the same directory as blender.exe

i tried the F7 and i get an error message
that test.py could not be loaded ?

meaming that it’s probably not complete yet
cause you should be able to load up any script yet
but i cannot only one name test.py

hope it’s going to change soon !

you hve anything else so we can learn more about that 2.5?

hope it helps

Just sit and wait until some dev htinks that crash issue is worthy of his attention to be fixed. Unless it’s complete you won’t be able to do much about this in the current situation.

where should this test.py be located

is it the same than the blender.exe?

i tried to put it there and it’s crashing too!

so i guess we have to wait a little to get the latest built to have anything working with this

thanks

according to the video it should be in the same directory as blender.exe, but i guess the feature is just too buggy to be used for now. but oddly it works in the video i dont get why it wouldnt now.

well video is the latest dev’s version

but that’s aint the latest SVN that’s why ?

may be next version will have the feature hopefully!

have you done some little script like how to replace the mesh and objecft with new operators

would like to begin to understands theses to make new mesh ojbect in 2.5 ?

thanks

No I’m an ultra beginner to blender scripts, I start way lower than that unfortunately =.=

i think sinced i worte that alot has changed in 2.5py and no longer valid

Oh I see, is there anywhere/anyone we can check for more recent info on this feature? Or maybe are you going to include it in tour #9? :slight_smile:

all i did was copy somthing from the ui scripts and make some changes thats all

Oh so maybe I’ll have the same luck by looking at the updated files?

but is there a small vid or pdf doc tut to show how you can begin to add some buttons
and how to control the looping for events ect…

i mean is it like the old one or not ?

and if not what are the differences ?

would like to elarn more but doc is rare right now !

and is there an SVN that can allow the loading of new script tio run and begin testing some of the new operators ?

and any example on how to make mesh and obj with new operators?

happy blendering

hey looks at this new info for 2.5 aPI

http://blenderartists.org/forum/showthread.php?p=1450643#post1450643

get a page for mesh or obejct in 2.5

hope to get more soon !

happy blendering 2.5

did you check thte last 2.5 API thread

there are beginning to give some goods pages for informel doc

like

index

and GUI
panels

hope it begins to help

Didnt he say it was imposible to run scripts in 2.5 trunk though? (I quickly went through the last few pages)

i did ask him again if there was a version avaiable so waiting for answer on this

i mean it should come out soon most of the API is almost done execpt for the doc

did you check the new doc API it’s more informel but it’s a beginning

hoep he can give some gopod sample of script to make mehs object and curves

and GUI

i 'd like to convert my scripts to 2.5 as soon as possible

if you find any good doc tut let us know about it

salutations

you dont need F7 to load up a script

just do as in 2.49
go to tex edtior and load up the script for 2.5 and run it

it works fine

hope it helps

Wow I got it to work (at least partially, it’s much more encouraging than an instant crash!), tyvm :slight_smile: