Hey #b3d peeps!!
何言っているかわかる人に届けば良いです。
矩形選択とか塗りつぶし選択ではできないこと。
ソースコード
#!BPY # ##### 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 ##### # [SelectMeshInvolved] # **This Version is Proof of Concept** # # Install # (1) Install this script to Blender (>2.78) # (2) Make sure "Object:Select Mesh Involved" is available and Checked # # How to use # (1) Select a Mesh Object # (2) In 3d View , Hit space key and type invo -> Enter # (3) 'Involved Object' is selected. # import bpy import mathutils bl_info = { "name": "Select Mesh Involved", "author": "blugjp", "blender": (2, 78, 0), "location": "Command search (Space bar) > Select Mesh Involved", "description": "Select Mesh Involved", "warning": "", "category": "Object", } def selectmeshinvolved(obj): maxx = maxy = maxz = None minx = miny = minz = None # Duplicate mesh to involve bpy.ops.object.duplicate_move() bpy.ops.object.convert(target='MESH') bpy.ops.object.transform_apply(location=False, rotation=True, scale=True) dupobj = bpy.context.object for v in dupobj.bound_box: maxx= max(v[0],maxx) if maxx!=None else v[0] maxy= max(v[1],maxy) if maxy!=None else v[1] minx= min(v[0],minx) if minx!=None else v[0] miny= min(v[1],miny) if miny!=None else v[1] # get center of boundingbox cx = (maxx +minx ) /2 cy = (maxy +miny ) /2 # get boundingbox size sx = (maxx -minx )/2 sy = (maxy -miny )/2 # add plane bpy.ops.mesh.primitive_plane_add(radius=1, view_align=False, enter_editmode=False, location=(cx,cy,0)) cutobj = bpy.context.object cutobj.scale =(sx,sy,1.0) # with boolian modifier scn = bpy.context.scene objlist= bpy.data.objects modone = dupobj.modifiers.new("Boolean_Slice", 'BOOLEAN') modtwo = dupobj.modifiers.new("Boolean_Scoop", 'BOOLEAN') for x in objlist: if x.type=="MESH": if not( x == cutobj or x == dupobj or x==obj): # move plane cutobj.location.z = x.location.z # boolean modifier setup modone.object = cutobj modtwo.object = x # apply modifier scn.update() mesh=dupobj.to_mesh(scn, True, 'PREVIEW') # select object if len(mesh.vertices) > 0 : x.select = True # delete mesh bpy.data.meshes.remove(mesh) # delete dupobj and cutobj bpy.data.objects.remove(dupobj,True) bpy.data.objects.remove(cutobj,True) class DialogOperator(bpy.types.Operator): bl_idname = "object.dialog_operator" bl_label = "Information" def execute(self, context): return {'FINISHED'} def invoke(self, context, event): wm = context.window_manager return wm.invoke_props_dialog(self) def draw(self, context): layout = self.layout col = layout.column() col.label(text=bpy.context.scene.minvdialog_message) class MeshInvolvedOperator(bpy.types.Operator): """Select Mesh Involved""" bl_label = "Select Mesh Involved" bl_idname = "object.select_mesh_involved" def execute(self, context): if bpy.context.mode == 'OBJECT': obj = bpy.context.object if obj.type == 'MESH': selectmeshinvolved(obj) else: bpy.context.scene.minvdialog_message = "This command is only for Mesh Object." bpy.ops.object.dialog_operator('INVOKE_DEFAULT') return {'CANCELLED'} else: bpy.context.scene.minvdialog_message = "Please change the mode to Object mode." bpy.ops.object.dialog_operator('INVOKE_DEFAULT') return {'CANCELLED'} return {'FINISHED'} # Registration def register(): bpy.utils.register_class(MeshInvolvedOperator) bpy.utils.register_class(DialogOperator) bpy.types.Scene.minvdialog_message =\ bpy.props.StringProperty(name="message", default='') def unregister(): bpy.utils.unregister_class(MeshInvolvedOperator) bpy.utils.unregister_class(DialogOperator) del bpy.types.Scene.minvdialog_message if __name__ == "__main__": register()