[Solved] Splitting Mesh into individual polygons? (Help!)

I have a model that I want to split all the connected tris into individual trigons. This is for a tutorial that I am working on demonstrating the remove doubles feature and working around mesh that have shapekeys and flipped normals.

If I select a face and press Y that face splits from the connecting tris use the python function
bpy.ops.mesh.split()

I thought this would be easy simply by walking through the polygons, selecting them and calling the split function.

So I put the model into Edit mode tried this code…

(meshes is defined as the context selected mesh object and the  object is in edit mode)

for obj in meshes:
    for sel in obj.data.polygons:
        sel.select = True
        bpy.ops.mesh.split()
        sel.select = False

The code runs without error, but nothing splits.

I don’t want to separate by polys and rejoin as the model is very large.

1 Like

So you want to basically just split every face (edge) in your model? Maybe edge split modifier with “split angel” set to 0 could help? edge_split
Edit : As someone said below there is a actually “edge split” tool (ctrl+e > edge split). I never used it, i always used “V” hotkey (rip vertices) to split some edges.

And i think nothing splits because that’s not how this operator supposed to work. It should split boundary edge loop of your current selection from the rest of the model , so when you select the whole model it can’t split itself from itself, if that’s what you were trying to do. (i don’t know anything about coding, so i can’t tell what your code was supposed to do, so i could be wrong) split

Oh, i knew your name looked familiar, just remembered where i saw it. I watched couple of your tutorials, thank you! They are very detailed and informative. :+1:

If you’re ok doing splitting with UI operators and not with Python then Ctrl+E > Edge Split is what you want (or indeed Edge Split modifier though it needs to be applied). In 2.8 the command should be in the same menu as in 2.79.

1 Like

Thanks guys,

Zak_Gre, I knew I could do this using Ctrl+E but I wanted to do it via Python and I finally figured it out… (DOH!)

import bpy

for object in bpy.context.selected_objects:
    bpy.ops.object.mode_set(mode = 'EDIT')       
    bpy.ops.mesh.select_all(action = 'SELECT') 
    bpy.ops.mesh.edge_split()

That does the trick!!!

Now I can get back to the tutorial!! (Weak yay!)