3
$\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$
3
$\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$
  • $\begingroup$ Wow - you are rescuing me - i seems to work perfectly. $\endgroup$ – Tithilion Sep 3 '16 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.