4
$\begingroup$

I need a Mesh (640x480) with vertex-indices for 0 to 639 in the first row, 640 to 1279 in the second row, and so on.... I will try to show what I mean in the picture:

enter image description here

First, I tried to use a Plane and subdivide it, but by doing that it destroy any useful indices of the Vertices. In my second attempt I use:

bpy.ops.mesh.primitive_grid_add(radius=1, view_align=False, enter_editmode=False, location=(0, -0, layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))

to create a Grid with bpy. It creates a 10x10 Mesh (9 faces a row), with indices like I need. Now it just have to be bigger. Does someone know a command to create a Grid like I need with the 640x480 vertices?

$\endgroup$

1 Answer 1

4
$\begingroup$

You can just add the x and y subdivisions argument:

bpy.ops.mesh.primitive_grid_add(x_subdivisions=640, y_subdivisions=480, radius=1, view_align=False, enter_editmode=False, location=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
$\endgroup$
1
  • $\begingroup$ Wow - you are rescuing me - i seems to work perfectly. $\endgroup$
    – Tithilion
    Sep 3, 2016 at 18:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .