2.5 Buttons
[blender-staging.git] / release / ui / buttons_data_armature.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         def poll(self, context):
10                 ob = context.active_object
11                 return (ob and ob.type == 'ARMATURE')
12
13 class DATA_PT_skeleton(DataButtonsPanel):
14         __idname__ = "DATA_PT_skeleton"
15         __label__ = "Skeleton"
16
17         def draw(self, context):
18                 arm = context.active_object.data
19                 layout = self.layout
20                 
21                 layout.itemR(arm, "rest_position")
22
23                 split = layout.split()
24
25                 sub = split.column()
26                 sub.itemL(text="Deform:")
27                 sub.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
28                 sub.itemR(arm, "deform_envelope", text="Envelopes")
29                 sub.itemR(arm, "deform_quaternion", text="Quaternion")
30                 sub.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
31                 #sub.itemR(arm, "x_axis_mirror")
32                 #sub.itemR(arm, "auto_ik")
33                 
34                 sub = split.column()
35                 sub.itemL(text="Layers:")
36                 sub.itemL(text="LAYERS")
37                 #sub.itemR(arm, "layer")
38                 #sub.itemR(arm, "layer_protection")
39
40 class DATA_PT_display(DataButtonsPanel):
41         __idname__ = "DATA_PT_display"
42         __label__ = "Display"
43         
44         def draw(self, context):
45                 arm = context.active_object.data
46                 layout = self.layout
47
48                 split = layout.split()
49
50                 sub = split.column()
51                 sub.itemR(arm, "drawtype", text="Style")
52                 sub.itemR(arm, "delay_deform", text="Delay Refresh")
53
54                 sub = split.column()
55                 sub.itemR(arm, "draw_names", text="Names")
56                 sub.itemR(arm, "draw_axes", text="Axes")
57                 sub.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
58                 sub.itemR(arm, "draw_group_colors", text="Colors")
59
60 class DATA_PT_paths(DataButtonsPanel):
61         __idname__ = "DATA_PT_paths"
62         __label__ = "Paths"
63
64         def draw(self, context):
65                 arm = context.active_object.data
66                 layout = self.layout
67
68                 split = layout.split()
69                 
70                 sub = split.column()
71                 sub.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
72                 if (arm.paths_show_around_current_frame):
73                         sub.itemR(arm, "path_before_current", text="Before")
74                         sub.itemR(arm, "path_after_current", text="After")
75                 else:
76                         sub.itemR(arm, "path_start_frame", text="Start")
77                         sub.itemR(arm, "path_end_frame", text="End")
78
79                 sub.itemR(arm, "path_size", text="Step")        
80                 sub.itemR(arm, "paths_calculate_head_positions", text="Head")
81                 
82                 sub = split.column()
83                 sub.itemL(text="Show:")
84                 sub.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
85                 sub.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
86                 sub.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
87
88 class DATA_PT_ghost(DataButtonsPanel):
89         __idname__ = "DATA_PT_ghost"
90         __label__ = "Ghost"
91
92         def draw(self, context):
93                 arm = context.active_object.data
94                 layout = self.layout
95
96                 split = layout.split()
97
98                 sub = split.column()
99                 sub.itemR(arm, "ghost_type", text="Scope")
100                 if arm.ghost_type == 'RANGE':
101                         sub.itemR(arm, "ghost_start_frame", text="Start")
102                         sub.itemR(arm, "ghost_end_frame", text="End")
103                         sub.itemR(arm, "ghost_size", text="Step")
104                 elif arm.ghost_type == 'CURRENT_FRAME':
105                         sub.itemR(arm, "ghost_step", text="Range")
106                         sub.itemR(arm, "ghost_size", text="Step")
107
108                 sub = split.column()
109                 sub.itemR(arm, "ghost_only_selected", text="Selected Only")
110
111 bpy.types.register(DATA_PT_skeleton)
112 bpy.types.register(DATA_PT_display)
113 bpy.types.register(DATA_PT_paths)
114 bpy.types.register(DATA_PT_ghost)