1

I need a lot of independent planes (like 200x300), but creating them programmatically with a loop took a lot of time (with bpy.ops.mesh.primitive_plane() or with vertices and faces). But creating one grid with subdivisions is very cheap. My problem is, that the vertices of the subdivision planes are connected and i need them independent (having each inner vertice four times).

So i would ask you, if there is an option to divide an grid in many independent planes?

vtni
  • 281
  • 3
  • 8

1 Answers1

1

you can use the edge split operator to divide the grid into individual squares , then you can separate them by loose parts , here is the lines that do that :

        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.mesh.select_all(action = 'SELECT')        
        bpy.ops.mesh.edge_split()
        bpy.ops.mesh.separate(type = 'LOOSE')
        bpy.ops.object.editmode_toggle()
Chebhou
  • 19,533
  • 51
  • 98
  • this works pretty good on small amounts (20x30), but if i use it on 200x300 blender freezes also. is there a solution for it? thanks a lot – vtni May 01 '15 at 21:02
  • I have tested this in the UI (no script) and blender is still frozen while i'm writing, so I suggest that you create small grid ( 10x10) separate this parts then loop over them subdivide each (20x30) and separate ( when you separate the planes will be selected so just loop through selected_object ) – Chebhou May 01 '15 at 21:11
  • can i divide a plane to a grid? – vtni May 01 '15 at 21:18
  • @vtni mesh.subdivide(number_cuts = 10) – Chebhou May 01 '15 at 22:46
  • i have one last question: how can i get all separated planes in a list, to iterate over them (and split again)? – vtni May 02 '15 at 12:17
  • @vtni list = context.selected_objects.copy() then loop in this list , it want change with the selection because it is a separate copy – Chebhou May 02 '15 at 12:23
  • unfortunately with this method the whole computer freezes. i think i have to take a look at Modals. – vtni May 02 '15 at 13:17