Newer
Older
# ##### 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.
#
# 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
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# ##### END GPL LICENSE BLOCK #####
# menu & updates by meta-androcto #
# contributed to by Macouno, dustractor, liero, CoDEmanX, meta-androcto #
bl_info = {
"name": "Select Tools",
"author": "Multiple Authors",
"version": (0, 3),
"location": "Editmode select menu",
"description": "Adds More vert/face/edge select modes.",
"warning": "",
CoDEmanX
committed
"wiki_url": "",
"tracker_url": "https://developer.blender.org/T32877",
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
"category": "Mesh"}
if "bpy" in locals():
import imp
imp.reload(mesh_select_by_direction)
imp.reload(mesh_select_by_edge_length)
imp.reload(mesh_select_by_pi)
imp.reload(mesh_select_by_type)
imp.reload(mesh_select_connected_faces)
imp.reload(mesh_select_innermost)
imp.reload(mesh_index_select)
imp.reload(mesh_selection_topokit)
imp.reload(mesh_info_select)
else:
from . import mesh_select_by_direction
from . import mesh_select_by_edge_length
from . import mesh_select_by_pi
from . import mesh_select_by_type
from . import mesh_select_connected_faces
from . import mesh_select_innermost
from . import mesh_index_select
from . import mesh_selection_topokit
from . import mesh_info_select
import bpy, bmesh
class VIEW3D_MT_selectface_edit_mesh_add(bpy.types.Menu):
# Define the "Mesh_Select_Tools" menu
bl_idname = "mesh.face_select_tools"
bl_label = "Select by Face"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.label(text = 'Face Select')
layout.separator()
CoDEmanX
committed
layout.operator("data.facetype_select",
CoDEmanX
committed
layout.operator("data.facetype_select",
CoDEmanX
committed
layout.operator("data.facetype_select",
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
text="Ngons").face_type = "5"
layout.separator()
layout.operator("mesh.select_vert_index",
text="By Face Index")
layout.operator("mesh.select_by_direction",
text="By Direction")
layout.operator("mesh.select_by_pi",
text="By Pi")
layout.operator("mesh.select_connected_faces",
text="By Connected Faces")
layout.operator("mesh.e2e_efe",
text="Neighbors by Face")
layout.operator("mesh.f2f_fvnef",
text="Neighbors by Vert not Edge")
layout.operator("mesh.conway",
text="Conway")
class VIEW3D_MT_selectedge_edit_mesh_add(bpy.types.Menu):
# Define the "Mesh_Select_Tools" menu
bl_idname = "mesh.edge_select_tools"
bl_label = "Select by Edge"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.label(text = 'Edge Select')
layout.separator()
layout.operator("mesh.select_vert_index",
text="By Edge Index")
layout.operator("mesh.select_by_direction",
text="By Direction")
layout.operator("mesh.select_by_pi",
text="By Pi")
layout.operator("mesh.select_by_edge_length",
text="By Edge Length")
layout.separator()
layout.operator("mesh.e2e_eve",
text="Neighbors by Vert")
layout.operator("mesh.e2e_evfe",
text="Neighbors by Vert + Face")
layout.operator("mesh.e2e_efnve",
text="Lateral Neighbors")
layout.operator("mesh.e2e_evnfe",
text="Longitudinal Edges")
# layout.operator("mesh.je",
# text="only_edge_selection")
CoDEmanX
committed
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
class VIEW3D_MT_selectvert_edit_mesh_add(bpy.types.Menu):
# Define the "Mesh_Select_Tools" menu
bl_idname = "mesh.vert_select_tools"
bl_label = "Select by Vert"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.label(text = 'Vert Select')
layout.separator()
layout.operator("mesh.select_vert_index",
text="By Vert Index")
layout.operator("mesh.select_by_direction",
text="By Direction")
layout.operator("mesh.select_by_pi",
text="By Pi")
# layout.operator("mesh.select_innermost",
# text="innermost")
layout.separator()
layout.operator("mesh.v2v_by_edge",
text="Neighbors by Edge")
layout.operator("mesh.e2e_eve",
text="Neighbors by Vert")
layout.operator("mesh.e2e_efe",
text="Neighbors by Face")
layout.operator("mesh.v2v_facewise",
text="Neighbors by Face - Edge")
# layout.operator("mesh.ie",
# text="inner_edge_selection")
# Register all operators and panels
# Define "Extras" menu
def menu_func(self, context):
if context.tool_settings.mesh_select_mode[2]:
self.layout.menu("mesh.face_select_tools", icon="PLUGIN")
if context.tool_settings.mesh_select_mode[1]:
self.layout.menu("mesh.edge_select_tools", icon="PLUGIN")
if context.tool_settings.mesh_select_mode[0]:
self.layout.menu("mesh.vert_select_tools", icon="PLUGIN")
def register():
bpy.utils.register_module(__name__)
bpy.types.VIEW3D_MT_select_edit_mesh.append(menu_func)
def unregister():
bpy.utils.unregister_module(__name__)
bpy.types.VIEW3D_MT_select_edit_mesh.remove(menu_func)
if __name__ == "__main__":
register()