4 class DataButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
9 def poll(self, context):
10 return (context.armature != None)
12 class DATA_PT_context_arm(DataButtonsPanel):
13 __idname__ = "DATA_PT_context_arm"
14 __show_header__ = False
16 def draw(self, context):
20 arm = context.armature
21 space = context.space_data
23 split = layout.split(percentage=0.65)
26 split.template_ID(ob, "data")
29 split.template_ID(space, "pin_id")
32 class DATA_PT_skeleton(DataButtonsPanel):
33 __idname__ = "DATA_PT_skeleton"
34 __label__ = "Skeleton"
36 def draw(self, context):
40 arm = context.armature
41 space = context.space_data
45 split = layout.split()
48 col.itemR(arm, "rest_position")
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")
60 sub.itemL(text="Layers:")
61 sub.template_layers(arm, "layer")
62 sub.itemL(text="Protected Layers:")
63 sub.template_layers(arm, "layer_protection")
65 class DATA_PT_display(DataButtonsPanel):
66 __idname__ = "DATA_PT_display"
69 def draw(self, context):
71 arm = context.armature
73 layout.row().itemR(arm, "drawtype", expand=True)
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")
82 class DATA_PT_bone_groups(DataButtonsPanel):
83 __idname__ = "DATA_PT_bone_groups"
84 __label__ = "Bone Groups"
86 def poll(self, context):
87 return (context.object and context.object.type=='ARMATURE' and context.object.pose)
89 def draw(self, context):
96 row.template_list(pose, "bone_groups", pose, "active_bone_group_index")
98 col = row.column(align=True)
99 col.itemO("pose.group_add", icon="ICON_ZOOMIN", text="")
100 col.itemO("pose.group_remove", icon="ICON_ZOOMOUT", text="")
102 group = pose.active_bone_group
104 col = layout.column()
105 col.itemR(group, "name")
107 split = layout.split(0.5)
108 split.itemR(group, "color_set")
110 split.template_triColorSet(group, "colors")
112 row = layout.row(align=True)
114 row.itemO("pose.group_assign", text="Assign")
115 row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
116 #row.itemO("object.bone_group_select", text="Select")
117 #row.itemO("object.bone_group_deselect", text="Deselect")
119 class DATA_PT_paths(DataButtonsPanel):
120 __idname__ = "DATA_PT_paths"
123 def draw(self, context):
125 arm = context.armature
127 split = layout.split()
130 sub.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
131 col = sub.column(align=True)
132 if (arm.paths_show_around_current_frame):
133 col.itemR(arm, "path_before_current", text="Before")
134 col.itemR(arm, "path_after_current", text="After")
136 col.itemR(arm, "path_start_frame", text="Start")
137 col.itemR(arm, "path_end_frame", text="End")
139 col.itemR(arm, "path_size", text="Step")
140 sub.itemR(arm, "paths_calculate_head_positions", text="Head")
143 sub.itemL(text="Show:")
144 sub.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
145 sub.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
146 sub.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
148 class DATA_PT_ghost(DataButtonsPanel):
149 __idname__ = "DATA_PT_ghost"
152 def draw(self, context):
154 arm = context.armature
156 split = layout.split()
159 sub.itemR(arm, "ghost_type", text="Scope")
161 col = sub.column(align=True)
162 if arm.ghost_type == 'RANGE':
163 col.itemR(arm, "ghost_start_frame", text="Start")
164 col.itemR(arm, "ghost_end_frame", text="End")
165 col.itemR(arm, "ghost_size", text="Step")
166 elif arm.ghost_type == 'CURRENT_FRAME':
167 col.itemR(arm, "ghost_step", text="Range")
168 col.itemR(arm, "ghost_size", text="Step")
171 sub.itemR(arm, "ghost_only_selected", text="Selected Only")
173 bpy.types.register(DATA_PT_context_arm)
174 bpy.types.register(DATA_PT_skeleton)
175 bpy.types.register(DATA_PT_display)
176 bpy.types.register(DATA_PT_bone_groups)
177 bpy.types.register(DATA_PT_paths)
178 bpy.types.register(DATA_PT_ghost)