Welcome to mirror list, hosted at ThFree Co, Russian Federation.

buttons_data_armature.py « ui « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5924a2eb4ea3a66aca8ee429e5ec9d4295410fbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

import bpy
 
class DataButtonsPanel(bpy.types.Panel):
	__space_type__ = 'PROPERTIES'
	__region_type__ = 'WINDOW'
	__context__ = "data"
	
	def poll(self, context):
		return (context.armature)

class DATA_PT_context_arm(DataButtonsPanel):
	__show_header__ = False
	
	def draw(self, context):
		layout = self.layout
		
		ob = context.object
		arm = context.armature
		space = context.space_data

		split = layout.split(percentage=0.65)

		if ob:
			split.template_ID(ob, "data")
			split.itemS()
		elif arm:
			split.template_ID(space, "pin_id")
			split.itemS()

class DATA_PT_skeleton(DataButtonsPanel):
	__label__ = "Skeleton"
	
	def draw(self, context):
		layout = self.layout
		
		ob = context.object
		arm = context.armature
		space = context.space_data

		split = layout.split()

		col = split.column()
		col.itemL(text="Layers:")
		col.itemR(arm, "layer", text="")
		col.itemL(text="Protected Layers:")
		col.itemR(arm, "layer_protection", text="")
		col.itemL(text="Edit Options:")
		col.itemR(arm, "x_axis_mirror")
		col.itemR(arm, "auto_ik")
		
		col = split.column()
		col.itemR(arm, "rest_position")
		col.itemL(text="Deform:")
		col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
		col.itemR(arm, "deform_envelope", text="Envelopes")
		col.itemR(arm, "deform_quaternion", text="Quaternion")
		col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
		
class DATA_PT_display(DataButtonsPanel):
	__label__ = "Display"
	
	def draw(self, context):
		layout = self.layout
		
		arm = context.armature

		layout.row().itemR(arm, "drawtype", expand=True)

		flow = layout.column_flow()
		flow.itemR(arm, "draw_names", text="Names")
		flow.itemR(arm, "draw_axes", text="Axes")
		flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
		flow.itemR(arm, "draw_group_colors", text="Colors")
		flow.itemR(arm, "delay_deform", text="Delay Refresh")

class DATA_PT_bone_groups(DataButtonsPanel):
	__label__ = "Bone Groups"
	
	def poll(self, context):
		return (context.object and context.object.type=='ARMATURE' and context.object.pose)

	def draw(self, context):
		layout = self.layout
		
		ob = context.object
		pose = ob.pose
		
		row = layout.row()
		row.template_list(pose, "bone_groups", pose, "active_bone_group_index")
		
		col = row.column(align=True)
		col.active = (ob.proxy == None)
		col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
		col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
		
		group = pose.active_bone_group
		if group:
			col = layout.column()
			col.active= (ob.proxy == None)
			col.itemR(group, "name")
			
			split = layout.split(0.5)
			split.active= (ob.proxy == None)
			split.itemR(group, "color_set")
			if group.color_set:
				split.template_triColorSet(group, "colors")
		
		row = layout.row(align=True)
		row.active = (ob.proxy == None)
		
		row.itemO("pose.group_assign", text="Assign")
		row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
		#row.itemO("object.bone_group_select", text="Select")
		#row.itemO("object.bone_group_deselect", text="Deselect")

class DATA_PT_paths(DataButtonsPanel):
	__label__ = "Paths"

	def draw(self, context):
		layout = self.layout
		
		arm = context.armature

		split = layout.split()
		
		col = split.column()
		col.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
		
		sub = col.column(align=True)
		if (arm.paths_show_around_current_frame):
			sub.itemR(arm, "path_before_current", text="Before")
			sub.itemR(arm, "path_after_current", text="After")
		else:
			sub.itemR(arm, "path_start_frame", text="Start")
			sub.itemR(arm, "path_end_frame", text="End")

		sub.itemR(arm, "path_size", text="Step")	
		col.itemR(arm, "paths_calculate_head_positions", text="Head")
		
		col = split.column()
		col.itemL(text="Show:")
		col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
		col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
		col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")

class DATA_PT_ghost(DataButtonsPanel):
	__label__ = "Ghost"

	def draw(self, context):
		layout = self.layout
		
		arm = context.armature

		split = layout.split()

		col = split.column()
		col.itemR(arm, "ghost_type", text="")

		sub = col.column(align=True)
		if arm.ghost_type == 'RANGE':
			sub.itemR(arm, "ghost_start_frame", text="Start")
			sub.itemR(arm, "ghost_end_frame", text="End")
			sub.itemR(arm, "ghost_size", text="Step")
		elif arm.ghost_type == 'CURRENT_FRAME':
			sub.itemR(arm, "ghost_step", text="Range")
			sub.itemR(arm, "ghost_size", text="Step")

		col = split.column()
		col.itemR(arm, "ghost_only_selected", text="Selected Only")

bpy.types.register(DATA_PT_context_arm)
bpy.types.register(DATA_PT_skeleton)
bpy.types.register(DATA_PT_display)
bpy.types.register(DATA_PT_bone_groups)
bpy.types.register(DATA_PT_paths)
bpy.types.register(DATA_PT_ghost)