GUI Creator Script

Ive been working on this for about a week or so and i think it is finally ready to have some people try it out. It seems to be fairly stable.

Some of us have used Visual Studios to design and create GUI’s. So why cant we have one for Blender? Well, now we do. You can add controls, change the control’s settings, size, location and more stuff to come. Click a button and it will create the python script for you that all you need to do is fill in the callback functions.

Please read the ReadMe first. Here is a link the the zip file.

Any bugs that need fixed or features you would like to see, just let me know.


is this for 2.49a or 2.5 ?

and are you talking about visual studio from microsoft here ?

happy blendering

Its for 2.49a and yes i am talking about visual studios from microsoft. It is no where near as complicated but thats where i kinda got the idea for this.

Cool idea, I was just thinking about this the other day!

trying now.

well not certain if that can be very userfull for 2.5

i mean that’s the next generation i guess

and we should all aim for 2.5
mind you for those who wants to stay with 2.49a
that’s good news!

but i would like to see something for 2.5 GUI!


Played some more. It’s very cool!

At first i missed the bit in the readme about using “g” to move interactively rather than numerically in the property area!

You asked for feedback, so I’m loving it!
If you wanted to expand functionality though here’s some thoughts:

When i’ve been looking at UI scripts I like to take the are size into account:

if i get variables for the width and height of the area (aw, ah) as follows:

aw , ah = Blender.Window.GetAreaSize()

I can now set things relative to the top of the screen:
y = ah -50

…or centered

x = aw/2 - buttonwidth/2
I could set a 5% margin…
x = aw*0.05

i could set the button width to 90%
bwidth = aw * 0.9

or position relative to the right of the area;

x = w - offset

It’d be nice if you could add an option for each widget to position relative to a point

eg top left, top right, topcenter, left, center, right bottom left, bottom right, bottom center…

maybe you could accept % for the other attributes… button width = 30%

On another note: if you could multi select the widgets then the property area could become “alignment tools”

eg “align left”, sets the x position of the selected widgets to the lowest “x” value
“distribute vertically” sets the vertical spacing of the widgets to be even

but it’s great work as is!

I did have in mind to “Anchor” objects to different corners. But this may come much later. I need to clean up the code ALOT. This was a quick program i flew through as quickly as possible to see if i could even do what i was hoping to do. I have several other things i would like to see in it first.

And in the readme i had that i want to implement multiselect. That way you could move them all together and have the different “Alignment” buttons to arrange widgets as needed.

Thanks for the feed back. :slight_smile:

Nice script! I think it would be cool if you could place images and also if you could use images as buttons ( for doing shelf buttons like in maya).

Loolarge, If that is possible it probably wont be implemented in a while but its a very nice idea. Im currently working on multi select and its almost done.

Here is the newest version of the GUI Creator. Some of the new features…

- Added Multi-Select
- Added Alignment and Centering Tools
- Added feature to select between saving script to hard drive or in text editor
- Modified how Grab Mode works

Any feed back is greatly appreciated!

Nice work on the updates!

I found the multiselect align (horizontal/vertical) were the opposite of what I expected and they had me crying out for an “undo”!.. but it’s really helpful.

I do wish I could do the coords relative to top left though… and some kind of pre-made scrollbar and tab functions would be handy too!

Well, i really had high hopes for this script but since it seems like no one is that interested in it I don’t see any use putting any more effort into it. Until there gets to be more interest, i think the script is going to be on hold. :frowning:

Well, just letting you know I’m interested. I think its a great script.

If you do stop working on it, would you think about continuing it when 2.50 is released?

This script was a quick test to see for one, if it could be done, and second how easy it was to do it. If i have enough interest in it then i will DEFINITELY redo it for 2.5 and add more and more features to it.

What exactly were you meaning by the scrollbar and tab functions? I had thought about adding a type of control with different tabs and different controls for each tab.

Don’t be disheartened!

sadly many will be taking Ricky Blenders view that 2.49 scripts are un-interesting at the moment because they won’t “just work” in 2.5…:rolleyes:

and from my own experience when you put a lot of work into a script and release it to the community it seems that not many will bother to respond… I don’t think that means they’re un-interested though!

As for the “tabs” and “scrollbars”… there’s no built in functions for these…

the Blender Draw module is really powerful but the difference between putting a few buttons on screen and offering complete control of everything is a massive difference with lots of stuff in the middle being disproportionately hard…

as a result most scripts offer very poor UIs

tabs are easier todo i guess as you could make a row of buttons, each of which draws a set of buttons whilst disabling the other sets… It’d be nice to be able to visualise this in a GUI like yours… you could go further and create a new type of widget specifically for tabs…

scroll bars are more tough as you have to get into lots of mouse events and setting updating the position coords of all the widgets… blender doesn’t even provide a way to distinguish “mouse down” and “mouse up” or “mouse over” out of the box… i’ve never tried as it seems like a LOT of work! i guess it goes back towhat i was saying about allignement… if you drew all of your widgets into " group blocks" rather than directly to the window area, and if those blocks could be heirarchical then stuff like scrolling (and tabbing) would be much much easier as you’d just have to update coordinates for the block with a scroll widget

It’d also make “relative placement” easier as the blockcould be moved as a whole…

IIRC someone was trying to write a toolkit for more high level UI stuff like this a year or two ago, but because it’s not become built in to blenders API I guess it got lost… can’t remember who was doing it…

anyway, A GUI for creating UI (like yours is) could really popularise itself if it made stuff like this easier… like “batteries included”:wink:

Thanks Michael. Those are really good ideas. I don’t know if i have time to start working on the code again. I start back to college this week. I may find some free time to play around with it and try some of the things you were talking about.