UI:
[blender-staging.git] / release / ui / buttons_data.py
1
2 import bpy
3
4 class DataButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "data"
8
9 class DATA_PT_modifiers(DataButtonsPanel):
10         __idname__ = "DATA_PT_modifiers"
11         __label__ = "Modifiers"
12
13         def draw(self, context):
14                 ob = context.active_object
15                 layout = self.layout
16
17                 if not ob:
18                         return
19
20                 layout.row()
21                 layout.item_menu_enumO("OBJECT_OT_modifier_add", "type")
22
23                 for md in ob.modifiers:
24                         sub = layout.box()
25
26                         sub.row()
27                         sub.itemR(md, "expanded", text="")
28                         sub.itemR(md, "name", text="")
29
30                         sub.itemR(md, "render", text="")
31                         sub.itemR(md, "realtime", text="")
32                         sub.itemR(md, "editmode", text="")
33                         sub.itemR(md, "on_cage", text="")
34
35                         if md.expanded:
36                                 sub.row()
37                                 sub.itemS()
38
39                                 if md.type == "ARMATURE":
40                                         self.armature(sub, md)
41
42         def armature(self, layout, md):
43                 layout.column()
44                 layout.itemR(md, "object")
45                 layout.row()
46                 layout.itemR(md, "vertex_group")
47                 layout.itemR(md, "invert")
48                 layout.column_flow()
49                 layout.itemR(md, "use_vertex_groups")
50                 layout.itemR(md, "use_bone_envelopes")
51                 layout.itemR(md, "quaternion")
52                 layout.itemR(md, "b_bone_rest")
53                 layout.itemR(md, "multi_modifier")
54
55 bpy.types.register(DATA_PT_modifiers)
56