My script disconnect only half faces

Hi, I wanted to make script in py - in theory it looks like this

  1. Select OBJECT.
  2. Select FIRST face
  3. Select SECOND face
  4. Separate it to make another object.
  5. repeat it by half of OBJECT faces (every time it disconnects 2 faces so there have to be half of it ;))

But I’ve a problem with it - Idk why but it only allow to make 97 objects (+1 which is main) where overall should be 194 (check out console - it shows that it disconnected 194 faces but whole object has 388, so it’s half of it).

I’m not pro in this - overall it’s my first script :wink:
Thanks for help, Pyrol

Blockquote index = 0
for i in range (0,194):
object = bpy.context.active_object
object.data.polygons[index].select = True #Selecting first face
index+=1
print(index , "<first ")
object.data.polygons[index].select = True #Selecting second face
index+=1
print(index , "<second ")
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.separate(type=“SELECTED”) #Separating these 2 faces to make another obj
bpy.ops.object.editmode_toggle()
bpy.ops.object.select_all(action=‘DESELECT’)
bpy.ops.object.mode_set(mode = ‘OBJECT’)
object = bpy.data.objects[‘Trawa’] #Name of BASE object
object.select = True