| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | # ##### BEGIN GPL LICENSE BLOCK ##### | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #  This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  | #  modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  | #  as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  | #  of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2009-11-03 07:23:02 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | #  This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  | #  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  | #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  | #  GNU General Public License for more details. | 
					
						
							| 
									
										
										
										
											2009-11-03 07:23:02 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | #  You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  | #  along with this program; if not, write to the Free Software Foundation, | 
					
						
							| 
									
										
										
										
											2010-02-12 13:34:04 +00:00
										 |  |  | #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							| 
									
										
										
										
											2009-11-01 15:21:20 +00:00
										 |  |  | # | 
					
						
							|  |  |  | # ##### END GPL LICENSE BLOCK ##### | 
					
						
							| 
									
										
										
										
											2009-10-31 20:16:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | # <pep8 compliant> | 
					
						
							| 
									
										
										
										
											2009-05-21 21:23:36 +00:00
										 |  |  | import bpy | 
					
						
							| 
									
										
										
										
											2010-01-08 08:54:41 +00:00
										 |  |  | from rna_prop_ui import PropertyPanel | 
					
						
							| 
									
										
										
										
											2009-05-21 21:23:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-16 10:21:00 +00:00
										 |  |  | narrowui = bpy.context.user_preferences.view.properties_width_check | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-05 14:29:05 +00:00
										 |  |  | class MESH_MT_vertex_group_specials(bpy.types.Menu): | 
					
						
							|  |  |  |     bl_label = "Vertex Group Specials" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2010-02-05 14:29:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							| 
									
										
										
										
											2010-02-22 23:32:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-05 14:29:05 +00:00
										 |  |  |         layout.operator("object.vertex_group_sort", icon='SORTALPHA') | 
					
						
							|  |  |  |         layout.operator("object.vertex_group_copy", icon='COPY_ID') | 
					
						
							|  |  |  |         layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA') | 
					
						
							| 
									
										
										
										
											2010-02-09 22:00:19 +00:00
										 |  |  |         layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA') | 
					
						
							| 
									
										
										
										
											2010-02-05 14:29:05 +00:00
										 |  |  |         layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class MESH_MT_shape_key_specials(bpy.types.Menu): | 
					
						
							|  |  |  |     bl_label = "Shape Key Specials" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2010-02-05 14:29:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.operator("object.shape_key_transfer", icon='COPY_ID') # icon is not ideal | 
					
						
							|  |  |  |         layout.operator("object.join_shapes", icon='COPY_ID') # icon is not ideal | 
					
						
							|  |  |  |         layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-21 21:23:36 +00:00
										 |  |  | class DataButtonsPanel(bpy.types.Panel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_space_type = 'PROPERTIES' | 
					
						
							|  |  |  |     bl_region_type = 'WINDOW' | 
					
						
							|  |  |  |     bl_context = "data" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def poll(self, context): | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |         engine = context.scene.render.engine | 
					
						
							|  |  |  |         return context.mesh and (engine in self.COMPAT_ENGINES) | 
					
						
							| 
									
										
										
										
											2009-05-21 21:23:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:42:34 +00:00
										 |  |  | class DATA_PT_context_mesh(DataButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "" | 
					
						
							|  |  |  |     bl_show_header = False | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							|  |  |  |         mesh = context.mesh | 
					
						
							|  |  |  |         space = context.space_data | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-14 23:24:15 +00:00
										 |  |  |             split = layout.split(percentage=0.65) | 
					
						
							|  |  |  |             if ob: | 
					
						
							|  |  |  |                 split.template_ID(ob, "data") | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 split.separator() | 
					
						
							| 
									
										
										
										
											2009-11-14 23:24:15 +00:00
										 |  |  |             elif mesh: | 
					
						
							|  |  |  |                 split.template_ID(space, "pin_id") | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 split.separator() | 
					
						
							| 
									
										
										
										
											2009-11-14 23:24:15 +00:00
										 |  |  |         else: | 
					
						
							|  |  |  |             if ob: | 
					
						
							|  |  |  |                 layout.template_ID(ob, "data") | 
					
						
							|  |  |  |             elif mesh: | 
					
						
							|  |  |  |                 layout.template_ID(space, "pin_id") | 
					
						
							| 
									
										
										
										
											2009-06-07 13:36:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-08 08:54:41 +00:00
										 |  |  | class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel): | 
					
						
							|  |  |  |     _context_path = "object.data" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2010-01-08 08:54:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-21 00:55:20 +00:00
										 |  |  | class DATA_PT_normals(DataButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Normals" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         mesh = context.mesh | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(mesh, "autosmooth") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         sub = col.column() | 
					
						
							|  |  |  |         sub.active = mesh.autosmooth | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         sub.prop(mesh, "autosmooth_angle", text="Angle") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 15:41:44 +00:00
										 |  |  |             col = split.column() | 
					
						
							|  |  |  |         else: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             col.separator() | 
					
						
							|  |  |  |         col.prop(mesh, "vertex_normal_flip") | 
					
						
							|  |  |  |         col.prop(mesh, "double_sided") | 
					
						
							| 
									
										
										
										
											2009-08-06 23:34:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-07 09:23:29 +00:00
										 |  |  | class DATA_PT_settings(DataButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Settings" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         mesh = context.mesh | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         layout.prop(mesh, "texture_mesh") | 
					
						
							| 
									
										
										
										
											2009-10-07 09:23:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | class DATA_PT_vertex_groups(DataButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Vertex Groups" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def poll(self, context): | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |         engine = context.scene.render.engine | 
					
						
							|  |  |  |         return (context.object and context.object.type in ('MESH', 'LATTICE') and (engine in self.COMPAT_ENGINES)) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							|  |  |  |         group = ob.active_vertex_group | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rows = 2 | 
					
						
							|  |  |  |         if group: | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  |             rows = 5 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row() | 
					
						
							|  |  |  |         row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = row.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         col.operator("object.vertex_group_add", icon='ZOOMIN', text="") | 
					
						
							|  |  |  |         col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="") | 
					
						
							| 
									
										
										
										
											2010-02-05 14:29:05 +00:00
										 |  |  |         col.menu("MESH_MT_vertex_group_specials", icon='DOWNARROW_HLT', text="") | 
					
						
							| 
									
										
										
										
											2010-05-04 12:31:24 +00:00
										 |  |  |         if group: | 
					
						
							|  |  |  |             col.operator("object.vertex_group_move", icon='TRIA_UP', text="").direction = 'UP' | 
					
						
							|  |  |  |             col.operator("object.vertex_group_move", icon='TRIA_DOWN', text="").direction = 'DOWN' | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if group: | 
					
						
							|  |  |  |             row = layout.row() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             row.prop(group, "name") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0: | 
					
						
							|  |  |  |             row = layout.row() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             sub = row.row(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             sub.operator("object.vertex_group_assign", text="Assign") | 
					
						
							|  |  |  |             sub.operator("object.vertex_group_remove_from", text="Remove") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             sub = row.row(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             sub.operator("object.vertex_group_select", text="Select") | 
					
						
							|  |  |  |             sub.operator("object.vertex_group_deselect", text="Deselect") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             layout.prop(context.tool_settings, "vertex_group_weight", text="Weight") | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | class DATA_PT_shape_keys(DataButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Shape Keys" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def poll(self, context): | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |         engine = context.scene.render.engine | 
					
						
							|  |  |  |         return (context.object and context.object.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE') and (engine in self.COMPAT_ENGINES)) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							|  |  |  |         key = ob.data.shape_keys | 
					
						
							| 
									
										
										
										
											2010-02-01 14:25:38 +00:00
										 |  |  |         kb = ob.active_shape_key | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         enable_edit = ob.mode != 'EDIT' | 
					
						
							|  |  |  |         enable_edit_value = False | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-22 17:41:35 +00:00
										 |  |  |         if ob.shape_key_lock is False: | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |             if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode): | 
					
						
							|  |  |  |                 enable_edit_value = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rows = 2 | 
					
						
							|  |  |  |         if kb: | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  |             rows = 5 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         row.template_list(key, "keys", ob, "active_shape_key_index", rows=rows) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = row.column() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-08 11:07:00 +00:00
										 |  |  |         sub = col.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         sub.operator("object.shape_key_add", icon='ZOOMIN', text="") | 
					
						
							|  |  |  |         sub.operator("object.shape_key_remove", icon='ZOOMOUT', text="") | 
					
						
							| 
									
										
										
										
											2010-02-05 14:29:05 +00:00
										 |  |  |         sub.menu("MESH_MT_shape_key_specials", icon='DOWNARROW_HLT', text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if kb: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             col.separator() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-08 11:07:00 +00:00
										 |  |  |             sub = col.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |             sub.operator("object.shape_key_move", icon='TRIA_UP', text="").type = 'UP' | 
					
						
							|  |  |  |             sub.operator("object.shape_key_move", icon='TRIA_DOWN', text="").type = 'DOWN' | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             split = layout.split(percentage=0.4) | 
					
						
							| 
									
										
										
										
											2009-11-08 11:07:00 +00:00
										 |  |  |             row = split.row() | 
					
						
							|  |  |  |             row.enabled = enable_edit | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |             if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 row.prop(key, "relative") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-08 11:07:00 +00:00
										 |  |  |             row = split.row() | 
					
						
							|  |  |  |             row.alignment = 'RIGHT' | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |             if not wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 layout.prop(key, "relative") | 
					
						
							| 
									
										
										
										
											2009-11-12 15:41:44 +00:00
										 |  |  |                 row = layout.row() | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-08 11:07:00 +00:00
										 |  |  |             sub = row.row(align=True) | 
					
						
							|  |  |  |             subsub = sub.row(align=True) | 
					
						
							|  |  |  |             subsub.active = enable_edit_value | 
					
						
							| 
									
										
										
										
											2010-01-11 15:28:00 +00:00
										 |  |  |             subsub.prop(ob, "shape_key_lock", text="") | 
					
						
							|  |  |  |             subsub.prop(kb, "mute", text="") | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             sub.prop(ob, "shape_key_edit_mode", text="") | 
					
						
							| 
									
										
										
										
											2010-02-22 23:32:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-05 14:29:05 +00:00
										 |  |  |             sub = row.row() | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |             sub.operator("object.shape_key_clear", icon='X', text="") | 
					
						
							| 
									
										
										
										
											2009-11-07 22:07:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |             row = layout.row() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             row.prop(kb, "name") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             if key.relative: | 
					
						
							|  |  |  |                 if ob.active_shape_key_index != 0: | 
					
						
							|  |  |  |                     row = layout.row() | 
					
						
							|  |  |  |                     row.active = enable_edit_value | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                     row.prop(kb, "value") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                     split = layout.split() | 
					
						
							| 
									
										
										
										
											2009-11-08 11:07:00 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                     col = split.column(align=True) | 
					
						
							|  |  |  |                     col.active = enable_edit_value | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                     col.label(text="Range:") | 
					
						
							|  |  |  |                     col.prop(kb, "slider_min", text="Min") | 
					
						
							|  |  |  |                     col.prop(kb, "slider_max", text="Max") | 
					
						
							| 
									
										
										
										
											2009-11-08 11:07:00 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |                     if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 15:41:44 +00:00
										 |  |  |                         col = split.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-08 11:07:00 +00:00
										 |  |  |                     col.active = enable_edit_value | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                     col.label(text="Blend:") | 
					
						
							| 
									
										
										
										
											2009-11-23 11:43:38 +00:00
										 |  |  |                     col.prop_object(kb, "vertex_group", ob, "vertex_groups", text="") | 
					
						
							|  |  |  |                     col.prop_object(kb, "relative_key", key, "keys", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             else: | 
					
						
							|  |  |  |                 row = layout.row() | 
					
						
							|  |  |  |                 row.active = enable_edit_value | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 row.prop(key, "slurph") | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | class DATA_PT_uv_texture(DataButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "UV Texture" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         me = context.mesh | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row() | 
					
						
							|  |  |  |         col = row.column() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = row.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         col.operator("mesh.uv_texture_add", icon='ZOOMIN', text="") | 
					
						
							|  |  |  |         col.operator("mesh.uv_texture_remove", icon='ZOOMOUT', text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         lay = me.active_uv_texture | 
					
						
							|  |  |  |         if lay: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             layout.prop(lay, "name") | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  | class DATA_PT_texface(DataButtonsPanel): | 
					
						
							|  |  |  |     bl_label = "Texture Face" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def poll(self, context): | 
					
						
							|  |  |  |         ob = context.active_object | 
					
						
							|  |  |  |         rd = context.scene.render | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-03 16:00:42 +00:00
										 |  |  |         return (context.mode == 'EDIT_MESH') and (rd.engine == 'BLENDER_GAME') and ob and ob.type == 'MESH' | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  |         col = layout.column() | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |         me = context.mesh | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |         tf = me.faces.active_tface | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |         if tf: | 
					
						
							|  |  |  |             split = layout.split() | 
					
						
							|  |  |  |             col = split.column() | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |             col.prop(tf, "tex") | 
					
						
							|  |  |  |             col.prop(tf, "light") | 
					
						
							|  |  |  |             col.prop(tf, "invisible") | 
					
						
							|  |  |  |             col.prop(tf, "collision") | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |             col.prop(tf, "shared") | 
					
						
							|  |  |  |             col.prop(tf, "twoside") | 
					
						
							|  |  |  |             col.prop(tf, "object_color") | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |             if wide_ui: | 
					
						
							|  |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |             col.prop(tf, "halo") | 
					
						
							|  |  |  |             col.prop(tf, "billboard") | 
					
						
							|  |  |  |             col.prop(tf, "shadow") | 
					
						
							|  |  |  |             col.prop(tf, "text") | 
					
						
							|  |  |  |             col.prop(tf, "alpha_sort") | 
					
						
							| 
									
										
										
										
											2010-04-17 19:05:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |             col = layout.column() | 
					
						
							|  |  |  |             col.prop(tf, "transp") | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             col.label(text="No UV Texture") | 
					
						
							| 
									
										
										
										
											2009-07-21 00:55:20 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | class DATA_PT_vertex_colors(DataButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Vertex Colors" | 
					
						
							| 
									
										
										
										
											2010-04-18 23:52:37 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         me = context.mesh | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         row = layout.row() | 
					
						
							|  |  |  |         col = row.column() | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2) | 
					
						
							| 
									
										
										
										
											2009-07-01 22:25:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         col = row.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         col.operator("mesh.vertex_color_add", icon='ZOOMIN', text="") | 
					
						
							|  |  |  |         col.operator("mesh.vertex_color_remove", icon='ZOOMOUT', text="") | 
					
						
							| 
									
										
										
										
											2009-06-27 01:15:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         lay = me.active_vertex_color | 
					
						
							|  |  |  |         if lay: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             layout.prop(lay, "name") | 
					
						
							| 
									
										
										
										
											2009-07-21 00:55:20 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | classes = [ | 
					
						
							|  |  |  |     MESH_MT_vertex_group_specials, | 
					
						
							|  |  |  |     MESH_MT_shape_key_specials, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     DATA_PT_context_mesh, | 
					
						
							|  |  |  |     DATA_PT_normals, | 
					
						
							|  |  |  |     DATA_PT_settings, | 
					
						
							|  |  |  |     DATA_PT_vertex_groups, | 
					
						
							|  |  |  |     DATA_PT_shape_keys, | 
					
						
							|  |  |  |     DATA_PT_uv_texture, | 
					
						
							| 
									
										
										
										
											2010-04-12 03:06:49 +00:00
										 |  |  |     DATA_PT_texface, | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  |     DATA_PT_vertex_colors, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     DATA_PT_custom_props_mesh] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def register(): | 
					
						
							|  |  |  |     register = bpy.types.register | 
					
						
							|  |  |  |     for cls in classes: | 
					
						
							|  |  |  |         register(cls) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-22 23:32:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  | def unregister(): | 
					
						
							|  |  |  |     unregister = bpy.types.unregister | 
					
						
							|  |  |  |     for cls in classes: | 
					
						
							|  |  |  |         unregister(cls) | 
					
						
							| 
									
										
										
										
											2010-02-16 09:55:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | if __name__ == "__main__": | 
					
						
							|  |  |  |     register() |