Make linux/scons default to python 3.1 rather then the version scons runs with.
[blender.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                 return (context.armature != None)
11
12 class DATA_PT_context_arm(DataButtonsPanel):
13         __idname__ = "DATA_PT_context_arm"
14         __no_header__ = True
15         
16         def draw(self, context):
17                 layout = self.layout
18                 
19                 ob = context.object
20                 arm = context.armature
21                 space = context.space_data
22
23                 split = layout.split(percentage=0.65)
24
25                 if ob:
26                         split.template_ID(ob, "data")
27                         split.itemS()
28                 elif arm:
29                         split.template_ID(space, "pin_id")
30                         split.itemS()
31
32 class DATA_PT_skeleton(DataButtonsPanel):
33         __idname__ = "DATA_PT_skeleton"
34         __label__ = "Skeleton"
35         
36         def draw(self, context):
37                 layout = self.layout
38                 
39                 ob = context.object
40                 arm = context.armature
41                 space = context.space_data
42
43
44                 if arm:
45                         split = layout.split()
46
47                         col = split.column()
48                         col.itemR(arm, "rest_position")
49
50                         sub = col.column()
51                         sub.itemL(text="Deform:")
52                         sub.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
53                         sub.itemR(arm, "deform_envelope", text="Envelopes")
54                         sub.itemR(arm, "deform_quaternion", text="Quaternion")
55                         sub.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
56                         #sub.itemR(arm, "x_axis_mirror")
57                         #sub.itemR(arm, "auto_ik")
58                         
59                         sub = split.column()
60                         sub.itemL(text="Layers:")
61                         sub.template_layers(arm, "layer")
62                         sub.itemL(text="Protected Layers:")
63                         sub.template_layers(arm, "layer_protection")
64
65 class DATA_PT_display(DataButtonsPanel):
66         __idname__ = "DATA_PT_display"
67         __label__ = "Display"
68         
69         def draw(self, context):
70                 layout = self.layout
71                 arm = context.armature
72
73                 layout.row().itemR(arm, "drawtype", expand=True)
74
75                 sub = layout.column_flow()
76                 sub.itemR(arm, "draw_names", text="Names")
77                 sub.itemR(arm, "draw_axes", text="Axes")
78                 sub.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
79                 sub.itemR(arm, "draw_group_colors", text="Colors")
80                 sub.itemR(arm, "delay_deform", text="Delay Refresh")
81
82 class DATA_PT_paths(DataButtonsPanel):
83         __idname__ = "DATA_PT_paths"
84         __label__ = "Paths"
85
86         def draw(self, context):
87                 layout = self.layout
88                 arm = context.armature
89
90                 split = layout.split()
91                 
92                 sub = split.column()
93                 sub.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
94                 col = sub.column(align=True)
95                 if (arm.paths_show_around_current_frame):
96                         col.itemR(arm, "path_before_current", text="Before")
97                         col.itemR(arm, "path_after_current", text="After")
98                 else:
99                         col.itemR(arm, "path_start_frame", text="Start")
100                         col.itemR(arm, "path_end_frame", text="End")
101
102                 col.itemR(arm, "path_size", text="Step")        
103                 sub.itemR(arm, "paths_calculate_head_positions", text="Head")
104                 
105                 sub = split.column()
106                 sub.itemL(text="Show:")
107                 sub.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
108                 sub.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
109                 sub.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
110
111 class DATA_PT_ghost(DataButtonsPanel):
112         __idname__ = "DATA_PT_ghost"
113         __label__ = "Ghost"
114
115         def draw(self, context):
116                 layout = self.layout
117                 arm = context.armature
118
119                 split = layout.split()
120
121                 sub = split.column()
122                 sub.itemR(arm, "ghost_type", text="Scope")
123
124                 col = sub.column(align=True)
125                 if arm.ghost_type == 'RANGE':
126                         col.itemR(arm, "ghost_start_frame", text="Start")
127                         col.itemR(arm, "ghost_end_frame", text="End")
128                         col.itemR(arm, "ghost_size", text="Step")
129                 elif arm.ghost_type == 'CURRENT_FRAME':
130                         col.itemR(arm, "ghost_step", text="Range")
131                         col.itemR(arm, "ghost_size", text="Step")
132
133                 sub = split.column()
134                 sub.itemR(arm, "ghost_only_selected", text="Selected Only")
135
136 bpy.types.register(DATA_PT_context_arm)
137 bpy.types.register(DATA_PT_skeleton)
138 bpy.types.register(DATA_PT_display)
139 bpy.types.register(DATA_PT_paths)
140 bpy.types.register(DATA_PT_ghost)