4
class LayoutDemoPanel(bpy.types.Panel):
5
"""Creates a Panel in the scene context of the properties editor"""
6
bl_label = "Layout Demo"
7
bl_idname = "SCENE_PT_layout"
8
bl_space_type = 'PROPERTIES'
9
bl_region_type = 'WINDOW'
12
def draw(self, context):
17
# Create a simple row.
18
layout.label(text=" Simple Row:")
21
row.prop(scene, "frame_start")
22
row.prop(scene, "frame_end")
24
# Create an row where the buttons are aligned to each other.
25
layout.label(text=" Aligned Row:")
27
row = layout.row(align=True)
28
row.prop(scene, "frame_start")
29
row.prop(scene, "frame_end")
31
# Create two columns, by using a split layout.
32
split = layout.split()
36
col.label(text="Column One:")
37
col.prop(scene, "frame_end")
38
col.prop(scene, "frame_start")
40
# Second column, aligned
41
col = split.column(align=True)
42
col.label(text="Column Two:")
43
col.prop(scene, "frame_start")
44
col.prop(scene, "frame_end")
47
layout.label(text="Big Button:")
50
row.operator("render.render")
52
# Different sizes in a row
53
layout.label(text="Different button sizes:")
54
row = layout.row(align=True)
55
row.operator("render.render")
59
sub.operator("render.render")
61
row.operator("render.render")
65
bpy.utils.register_class(LayoutDemoPanel)
69
bpy.utils.unregister_class(LayoutDemoPanel)
72
if __name__ == "__main__":