Buttons, panels, and menus. In this chapter of Scripting for Artists, Sybren shows the basics of creating your own user interface in Blender.
- Finding existing UI code: 00:55
- Ingredients of a Panel: 01:42
- Different import styles: 03:00
- Monkey Grid panel: 04:09
- Adding operator buttons: 06:03
- Basic layout tweaks: 09:21
- Adding scene and object properties: 10:20
- Conditional drawing: 13:26
- Adding operators to menus: 15:30
4 Comments
Join to comment publicly.
Samuel Bernou
19th April 2020 - 13:39
A very clear and resourceful video. Even after making 30+ addons I learned a few things. e.g: I will certainly use columns starting now ;), thanks Doc.
Tijm Lanjouw
20th July 2020 - 13:15
Thanks for the tutorial. But how do I make the x, y and size values be defined by user input in the panel? I tried:
The fields with the default paramaters show up in the panel, but I'm not able to change them. My guess is that I have to work with variables. I tried a couple of things, but I failed. Anyone?
Sybren A. Stüvel
4th August 2020 - 15:53
*@Tijm Lanjouw* You have to define the user-editable properties somewhere else. If they are to be saved within the blend file, you typically would add them to
bpy.types.Scene
. If they are temporary, you typically add them tobpy.types.WindowManager
. You can then use them to assign for exampleprops.count_x = context.scene.my_monkey_grid_count_x
.You cannot use operator properties with
layout.prop()
.Ludwig Heijden
2nd January 2021 - 22:40
@Sybren A. Stüvel For those searching, this is explained better in chapter 11 ;)