| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | import bpy | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DataButtonsPanel(bpy.types.Panel): | 
					
						
							|  |  |  | 	__space_type__ = "BUTTONS_WINDOW" | 
					
						
							|  |  |  | 	__region_type__ = "WINDOW" | 
					
						
							|  |  |  | 	__context__ = "data" | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	def poll(self, context): | 
					
						
							| 
									
										
										
										
											2009-06-18 14:20:25 +00:00
										 |  |  | 		return (context.object and context.object.type == 'TEXT' and context.curve) | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | class DATA_PT_context(DataButtonsPanel): | 
					
						
							|  |  |  | 	__idname__ = "DATA_PT_context" | 
					
						
							|  |  |  | 	__label__ = " " | 
					
						
							| 
									
										
										
										
											2009-06-13 21:22:21 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	def poll(self, context): | 
					
						
							|  |  |  | 		ob = context.object | 
					
						
							| 
									
										
										
										
											2009-06-18 14:20:25 +00:00
										 |  |  | 		return (context.object and context.object.type == 'TEXT') | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-07 13:36:12 +00:00
										 |  |  | 	def draw(self, context): | 
					
						
							| 
									
										
										
										
											2009-06-13 21:22:21 +00:00
										 |  |  | 		layout = self.layout | 
					
						
							|  |  |  | 		 | 
					
						
							| 
									
										
										
										
											2009-06-07 13:36:12 +00:00
										 |  |  | 		ob = context.object | 
					
						
							|  |  |  | 		curve = context.curve | 
					
						
							|  |  |  | 		space = context.space_data | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		split = layout.split(percentage=0.65) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if ob: | 
					
						
							| 
									
										
										
										
											2009-06-23 00:19:10 +00:00
										 |  |  | 			split.template_ID(ob, "data") | 
					
						
							| 
									
										
										
										
											2009-06-07 13:36:12 +00:00
										 |  |  | 			split.itemS() | 
					
						
							|  |  |  | 		elif curve: | 
					
						
							| 
									
										
										
										
											2009-06-23 00:19:10 +00:00
										 |  |  | 			split.template_ID(space, "pin_id") | 
					
						
							| 
									
										
										
										
											2009-06-07 13:36:12 +00:00
										 |  |  | 			split.itemS() | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | class DATA_PT_shape_text(DataButtonsPanel): | 
					
						
							|  |  |  | 	__idname__ = "DATA_PT_shape_text" | 
					
						
							|  |  |  | 	__label__ = "Shape Text" | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	def poll(self, context): | 
					
						
							|  |  |  | 		ob = context.object | 
					
						
							|  |  |  | 		return (context.object and context.object.type == 'TEXT') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def draw(self, context): | 
					
						
							|  |  |  | 		layout = self.layout | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		ob = context.object | 
					
						
							|  |  |  | 		curve = context.curve | 
					
						
							|  |  |  | 		space = context.space_data | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-07 13:36:12 +00:00
										 |  |  | 		if curve: | 
					
						
							| 
									
										
										
										
											2009-05-24 12:37:55 +00:00
										 |  |  | 			layout.itemR(curve, "curve_2d")			 | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 							 | 
					
						
							|  |  |  | 			split = layout.split() | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 			sub = split.column() | 
					
						
							|  |  |  | 			sub.itemL(text="Caps:") | 
					
						
							|  |  |  | 			sub.itemR(curve, "front") | 
					
						
							|  |  |  | 			sub.itemR(curve, "back") | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 			sub.itemL(text="Textures:") | 
					
						
							|  |  |  | 			sub.itemR(curve, "uv_orco") | 
					
						
							| 
									
										
										
										
											2009-05-19 17:13:33 +00:00
										 |  |  | 			sub.itemR(curve, "auto_texspace") | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 			 | 
					
						
							|  |  |  | 			sub = split.column()	 | 
					
						
							|  |  |  | 			sub.itemL(text="Resolution:") | 
					
						
							|  |  |  | 			sub.itemR(curve, "resolution_u", text="Preview U") | 
					
						
							|  |  |  | 			sub.itemR(curve, "resolution_v", text="Preview V") | 
					
						
							|  |  |  | 			sub.itemR(curve, "render_resolution_u", text="Render U") | 
					
						
							|  |  |  | 			sub.itemR(curve, "render_resolution_v", text="Render V") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			sub.itemL(text="Display:") | 
					
						
							|  |  |  | 			sub.itemR(curve, "fast") | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | class DATA_PT_geometry(DataButtonsPanel): | 
					
						
							|  |  |  | 	__idname__ = "DATA_PT_geometry" | 
					
						
							|  |  |  | 	__label__ = "Geometry" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def draw(self, context): | 
					
						
							|  |  |  | 		layout = self.layout | 
					
						
							|  |  |  | 		curve = context.curve | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		split = layout.split() | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 		sub = split.column() | 
					
						
							|  |  |  | 		sub.itemL(text="Modification:") | 
					
						
							|  |  |  | 		sub.itemR(curve, "width") | 
					
						
							|  |  |  | 		sub.itemR(curve, "extrude") | 
					
						
							|  |  |  | 		sub.itemR(curve, "taper_object") | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		sub = split.column() | 
					
						
							|  |  |  | 		sub.itemL(text="Bevel:") | 
					
						
							|  |  |  | 		sub.itemR(curve, "bevel_depth", text="Depth") | 
					
						
							|  |  |  | 		sub.itemR(curve, "bevel_resolution", text="Resolution") | 
					
						
							|  |  |  | 		sub.itemR(curve, "bevel_object") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | class DATA_PT_font(DataButtonsPanel): | 
					
						
							|  |  |  | 	__idname__ = "DATA_PT_font" | 
					
						
							|  |  |  | 	__label__ = "Font" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def draw(self, context): | 
					
						
							|  |  |  | 		layout = self.layout | 
					
						
							| 
									
										
										
										
											2009-06-13 21:22:21 +00:00
										 |  |  | 		text = context.curve | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		layout.row() | 
					
						
							|  |  |  | 		layout.itemR(text, "font") | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		split = layout.split() | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		sub = split.column()	 | 
					
						
							|  |  |  | 	#	sub.itemR(text, "style") | 
					
						
							| 
									
										
										
										
											2009-05-24 12:37:55 +00:00
										 |  |  | 	#	sub.itemR(text, "bold") | 
					
						
							|  |  |  | 	#	sub.itemR(text, "italic") | 
					
						
							|  |  |  | 	#	sub.itemR(text, "underline") | 
					
						
							|  |  |  | 	# 	ToDo: These settings are in a sub struct (Edit Format).  | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 		sub.itemR(text, "text_size")		 | 
					
						
							|  |  |  | 		sub.itemR(text, "shear") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		sub = split.column() | 
					
						
							|  |  |  | 		sub.itemR(text, "text_on_curve") | 
					
						
							|  |  |  | 		sub.itemR(text, "family") | 
					
						
							|  |  |  | 		sub.itemL(text="Underline:") | 
					
						
							|  |  |  | 		sub.itemR(text, "ul_position", text="Position") | 
					
						
							|  |  |  | 		sub.itemR(text, "ul_height", text="Height") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	#	sub.itemR(text, "edit_format") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DATA_PT_paragraph(DataButtonsPanel): | 
					
						
							|  |  |  | 	__idname__ = "DATA_PT_paragraph" | 
					
						
							|  |  |  | 	__label__ = "Paragraph" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def draw(self, context): | 
					
						
							|  |  |  | 		layout = self.layout | 
					
						
							| 
									
										
										
										
											2009-06-13 21:22:21 +00:00
										 |  |  | 		text = context.curve | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-24 12:37:55 +00:00
										 |  |  | 		layout.itemL(text="Align:") | 
					
						
							|  |  |  | 		layout.itemR(text, "spacemode", expand=True) | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		split = layout.split() | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		sub = split.column()	 | 
					
						
							|  |  |  | 		sub.itemL(text="Spacing:") | 
					
						
							|  |  |  | 		sub.itemR(text, "spacing", text="Character") | 
					
						
							|  |  |  | 		sub.itemR(text, "word_spacing", text="Word") | 
					
						
							|  |  |  | 		sub.itemR(text, "line_dist", text="Line") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		sub = split.column() | 
					
						
							|  |  |  | 		sub.itemL(text="Offset:") | 
					
						
							|  |  |  | 		sub.itemR(text, "x_offset", text="X") | 
					
						
							|  |  |  | 		sub.itemR(text, "y_offset", text="Y") | 
					
						
							|  |  |  | 		sub.itemR(text, "wrap") | 
					
						
							| 
									
										
										
										
											2009-06-13 21:22:21 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | """		
 | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | class DATA_PT_textboxes(DataButtonsPanel): | 
					
						
							|  |  |  | 		__idname__ = "DATA_PT_textboxes" | 
					
						
							|  |  |  | 		__label__ = "Text Boxes" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		def draw(self, context): | 
					
						
							|  |  |  | 			layout = self.layout | 
					
						
							| 
									
										
										
										
											2009-06-13 21:22:21 +00:00
										 |  |  | 			text = context.curve | 
					
						
							|  |  |  | """
 | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | bpy.types.register(DATA_PT_context)	 | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | bpy.types.register(DATA_PT_shape_text)	 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:07:25 +00:00
										 |  |  | bpy.types.register(DATA_PT_geometry) | 
					
						
							| 
									
										
										
										
											2009-05-19 15:38:36 +00:00
										 |  |  | bpy.types.register(DATA_PT_font) | 
					
						
							|  |  |  | bpy.types.register(DATA_PT_paragraph) | 
					
						
							| 
									
										
										
										
											2009-06-03 00:17:35 +00:00
										 |  |  | #bpy.types.register(DATA_PT_textboxes) |