Creating a custom window/toolbar - what do I need to know?

I am starting to learn a bit of python after watching some tutorials about it and I am interested in using this knowledge to customize the Blender GUI to my liking.

What I mainly would like to do is to create a completely new custom toolbar/window containing a few useful buttons and dock it in the 3D view like in the mockup image below (the panel on the left). To clarify, I don’t want this window to replace the default toolbar in the 3D view nor do I simply want to extend it. I want it to be a completely new window.

I have found many tutorials explaining how to add simple buttons to the default toolbar but none that explain how to add another one. I suspect that you need to dwell further into coding to do what I want to do here, possibly even editing the source-code and compiling my own Blender build.

Also to further extend on my question, would it also be possible to add “tabs” to a window like in the bottom-right of my image?

Thanks in advance.

The Blender/Python API can’t (yet)…

  • Create new space types.

http://www.blender.org/documentation/blender_python_api_2_69_0/info_quickstart.html

Same applies to sidebars. They are subject to C-programming, here’s something about adding new spaces:
http://wiki.blender.org/index.php/Dev:2.6/Source/Tutorials/AddAnEditor

I see, bummer you can’t do it in python but thank you for pointing me in the right direction :slight_smile:

you can of course add buttons etc. to existing toolbars, and even draw overlays over any space (check out pie menus addon!)
What seems impossible atm is to scale the icons of operator buttons, they seem to be fixed size, even if the button is made larger by script. With this experimental patch, you could do it however: http://www.youtube.com/watch?v=mRiTfLpRlRU
It won’t be available in trunk any time soon, as it seriously slows down blender due to the high amount of drawning operations with opengl in immediate mode.

The scale of the icons I believe is controlled by the DPI, it’s not a high priority for me to have bigger icons on my sidebar.

That experimental patch seems interesting but performance is really important for me. Also I should note that I am primarily looking to modify the code for Blender 2.64 since that is the version I work with.

Thanks a ton for your help :slight_smile:

well i guess they scale with dpi, but everything else will do too.

If you just wanna have icons in the left sidebar in 3d view instead of text buttons, that’s absolutely possible with python scripting. Just modify the Blender\2.64\scripts\startup\bl_ui\space_view3d_toolbar.py file.

Some thing like:

col = layout.column()
col.operator("…", emboss=False)

Is there a particular reason why you wanna stick to 2.64?

2.64 is just what I use for all my work. I have tons of scripts saved for it and have created my own custom keymap that breaks in later versions. I have used it for a long time and I know that it works for everything I need it to do.

About modifying the existing toolbar. I thought of that, and I tried it at first but it breaks a lot of the functionality in the toolbar, like the sculpting properties and stuff like that I want to keep. The best possible solution is to create an extra panel/toolbar for the buttons.