| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | import bpy | 
					
						
							|  |  |  |   | 
					
						
							| 
									
										
										
										
											2009-05-28 23:45:50 +00:00
										 |  |  | class BoneButtonsPanel(bpy.types.Panel): | 
					
						
							| 
									
										
										
										
											2009-05-20 02:17:53 +00:00
										 |  |  | 	__space_type__ = "BUTTONS_WINDOW" | 
					
						
							|  |  |  | 	__region_type__ = "WINDOW" | 
					
						
							|  |  |  | 	__context__ = "bone" | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	def poll(self, context): | 
					
						
							| 
									
										
										
										
											2009-06-19 14:56:49 +00:00
										 |  |  | 		return (context.bone or context.edit_bone) | 
					
						
							| 
									
										
										
										
											2009-05-20 02:17:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:42:34 +00:00
										 |  |  | class BONE_PT_context_bone(BoneButtonsPanel): | 
					
						
							|  |  |  | 	__idname__ = "BONE_PT_context_bone" | 
					
						
							| 
									
										
										
										
											2009-07-09 19:45:27 +00:00
										 |  |  | 	__no_header__ = True | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	def draw(self, context): | 
					
						
							|  |  |  | 		layout = self.layout | 
					
						
							|  |  |  | 		bone = context.bone | 
					
						
							|  |  |  | 		if not bone: | 
					
						
							|  |  |  | 			bone = context.edit_bone | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		split = layout.split(percentage=0.06) | 
					
						
							|  |  |  | 		split.itemL(text="", icon="ICON_BONE_DATA") | 
					
						
							|  |  |  | 		split.itemR(bone, "name", text="") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-28 23:45:50 +00:00
										 |  |  | class BONE_PT_bone(BoneButtonsPanel): | 
					
						
							|  |  |  | 	__idname__ = "BONE_PT_bone" | 
					
						
							| 
									
										
										
										
											2009-05-20 02:17:53 +00:00
										 |  |  | 	__label__ = "Bone" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-20 02:17:53 +00:00
										 |  |  | 	def draw(self, context): | 
					
						
							|  |  |  | 		layout = self.layout | 
					
						
							| 
									
										
										
										
											2009-06-13 21:22:21 +00:00
										 |  |  | 		bone = context.bone | 
					
						
							| 
									
										
										
										
											2009-06-19 14:56:49 +00:00
										 |  |  | 		if not bone: | 
					
						
							|  |  |  | 			bone = context.edit_bone | 
					
						
							| 
									
										
										
										
											2009-05-20 02:17:53 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 		sub = split.column() | 
					
						
							|  |  |  | 		sub.itemR(bone, "parent") | 
					
						
							|  |  |  | 		sub.itemR(bone, "connected") | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		sub.itemL(text="Layers:") | 
					
						
							|  |  |  | 		sub.template_layers(bone, "layer") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		sub = split.column() | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		sub.itemL(text="Inherit:") | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | 		sub.itemR(bone, "hinge", text="Rotation") | 
					
						
							|  |  |  | 		sub.itemR(bone, "inherit_scale", text="Scale") | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		sub.itemL(text="Display:") | 
					
						
							|  |  |  | 		sub.itemR(bone, "draw_wire", text="Wireframe") | 
					
						
							|  |  |  | 		sub.itemR(bone, "hidden", text="Hide") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | 		 | 
					
						
							|  |  |  | class BONE_PT_deform(BoneButtonsPanel): | 
					
						
							|  |  |  | 	__idname__ = "BONE_PT_deform" | 
					
						
							|  |  |  | 	__label__ = "Deform" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def draw_header(self, context): | 
					
						
							|  |  |  | 		layout = self.layout | 
					
						
							|  |  |  | 		bone = context.bone | 
					
						
							|  |  |  | 		if not bone: | 
					
						
							|  |  |  | 			bone = context.edit_bone | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 		layout.itemR(bone, "deform", text="") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def draw(self, context): | 
					
						
							|  |  |  | 		layout = self.layout | 
					
						
							|  |  |  | 		bone = context.bone | 
					
						
							|  |  |  | 		if not bone: | 
					
						
							|  |  |  | 			bone = context.edit_bone | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 		layout.active = bone.deform | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 		split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		sub = split.column() | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 		sub.itemL(text="Envelope:") | 
					
						
							|  |  |  | 		sub.itemR(bone, "envelope_distance", text="Distance") | 
					
						
							|  |  |  | 		sub.itemR(bone, "envelope_weight", text="Weight") | 
					
						
							|  |  |  | 		sub.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply") | 
					
						
							|  |  |  | 		sub = split.column() | 
					
						
							| 
									
										
										
										
											2009-06-13 11:52:33 +00:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 		sub.itemL(text="Curved Bones:") | 
					
						
							|  |  |  | 		sub.itemR(bone, "bbone_segments", text="Segments") | 
					
						
							|  |  |  | 		sub.itemR(bone, "bbone_in", text="Ease In") | 
					
						
							|  |  |  | 		sub.itemR(bone, "bbone_out", text="Ease Out") | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		sub.itemR(bone, "cyclic_offset") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:42:34 +00:00
										 |  |  | bpy.types.register(BONE_PT_context_bone) | 
					
						
							| 
									
										
										
										
											2009-06-19 14:56:49 +00:00
										 |  |  | bpy.types.register(BONE_PT_bone) | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | bpy.types.register(BONE_PT_deform) |