17th April 2020
Buttons, panels, and menus. In this chapter of Scripting for Artists, Sybren shows the basics of creating your own user interface in Blender.
Login to comment publicly.
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.
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:
def draw(self, context): #draw panel
col = self.layout.column(align=True)
props = col.operator('mesh.monkey_grid',
text = 'Generate Grid',
icon = 'MONKEY')
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?
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 to bpy.types.WindowManager. You can then use them to assign for example props.count_x = context.scene.my_monkey_grid_count_x.
props.count_x = context.scene.my_monkey_grid_count_x
You cannot use operator properties with layout.prop().