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