Creating a Custom Menu with Python Scripting

preview_player
Показать описание
Make your own menus for a faster workflow and more customized Blender.

There are so many different tools, menus, and options in Blender that it is impossible to perfectly fit everyone's ideal workflow. Some people like big menus, some people prefer hotkeys, and others still want only iconized toolbars. Blender will never be exactly like we each want it, but luckily this is where Python comes in!

Blender's Python integration allows us to create our own menus, toolbar panels, and other things by writing simple scripts. We can then install these scripts as add-ons and adapt our workflow how we choose.

In this tutorial you'll learn how to write a simple add-on that creates a custom menu. After writing the script you'll be able to easily customize the menu by filling it with almost anything you like.

Рекомендации по теме
Комментарии
Автор

10 years on and this is still how you do it. Love that consistency from the Blender team

priceyindividual
Автор

yes! yes! I will like to see more python/blender tutorial, Thank you, in 1080p resolution will be better

elvin
Автор

In Blender 2.8 they changed a few things around, but nonetheless, here I am, seven years after you have made this video available, and am finally able to roll a few of my custom workflow utiliy scripts into a neat and tidy addon that I can more easily change between my workstations. Thank you very much!

johannesisphording
Автор

Thank you! I have never actually used python before (just 1 time), and I can still follow and understand!

theblenderacademy
Автор

you never know how usefull comments are if you have never written any script or programm by yourself. But great tutorial

Wasabia
Автор

Damn man, you teach programming way better than actual programmers. Congrats.

caruya
Автор

thanx for the awesome tute! i think i broke thru to the next level with this one ... i'm thinking in terms of much larger chunks of code now. You wanted suggestions for another tute? Do one on modeling something using bmesh - maybe start by adding in a cube and use script to to turn it into a star or something, one vert at a time, extrude vert to x, y, z target, that kind of thing. Jonathan, you are the king of blender scripting tutes

serenityrahn
Автор

Very awesome, the structure is really logical and builds to show how to do this. Only thing I’d change is the class name to myCustomMenu, so it’s easy to tell it’s not an API class/call

douglee
Автор

Thanks BC!
What about deepening on how to link a Python function to the menu item in order to add personally developed code?

shoejobluv
Автор

Nice! I have no python experience and it all made sense. I am definitely gonna make me some menus! (They’re oddly satisfying 🙂) good job!

corbanfinn
Автор

thank you i created my own menu by watching your scripting video and copy paste the commands from the info.but some commands have multiply commands in one command and i do not see how to set it up if you can help or some video nice tutorial thank you for the Help ! :D cheers

dimitardimitrov
Автор

very useful, thank you. i wish there were more blender python tutorials like this. cgcookie, even 6 years later, still has very few scripting tutorials of any sort. maybe now that 2.8 is so close to final release that will change.

juliandarley
Автор

hi, nice tut, but when trying to load as add on i get an error...AttributeError: '_RestrictContext' object has no attribute 'scene'
Any idea what it means?
thanks j

jimmyjames
Автор

That was great and straight to the point ! Thanks :)

piorism
Автор

Why is 720p greyed out for me!? I Can't read the damn text now, it was fine for almost 12 minutes and then it shifted into 360 on its own. This is totally not okay.

lokinomagra
Автор

Would like to see a tutorial on how to set up hotkeys in the code, like you mentioned :-)

xMath
Автор

It's really hard to follow tutorials from pre-2.9 era - nothing is the same in 2.9. VERY frustrating!

SteveBakerIsHere
Автор

Thanks for the tips! One question. Is there a way to create an operator that adds a custom particle system with your own settings to the scene via script?

JBHMEDIA
Автор

Very few tuts on Blender python on youtube, your's is probably the best.
I was wondering how you would change a property which is a collection of values like a grease pencil color (stroke +fillcolor) via an operator, considering it is not already defined in blender and their seem to be no pointer functions to point to collection of properties.Thanks.

starzar
Автор

I think you're being absolute about something rather relative. It depends on the code and it depends on the comments. Comments have their good use. Not all code in all situations is self-explanatory. If your comments are equally well-structured and uses good names, it can save you time with deciphering the code blocks, especially if the blocks are rather lengthy, and you just want to tersely explain to your team about what that block does. It's relative and depends on the developer's needs.

SuperGamer
welcome to shbcf.ru