Created
August 28, 2017 05:48
-
-
Save dreisicht/fecb37baae8c240a664bbe9430c8beda to your computer and use it in GitHub Desktop.
Blender Python script to improve function separate by loose parts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
# edit mode | |
bpy.ops.object.mode_set(mode='EDIT') | |
# TODO: lookup if disable window for script run is worth it | |
for #loop | |
# TODO: lookup if for loop or while loop is quicker | |
# select one Vertex | |
bpy.ops.mesh.select_vert_edge_face_index(select_type='VERT') | |
# select linked | |
bpy.ops.mesh.select_linked() | |
# get number of selected vertices | |
selectedVertices = | |
# lookup if last part | |
if selectedVertices = allVertices: | |
#abort | |
# separate vertices | |
bpy.ops.mesh.separate(type= 'SELECTED') | |
#get number of all vertices | |
allVertices = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment