3
$\begingroup$

I have created a cylinder using python API of blender. This cylinder has only vertical strips. I want horizontal loop cuts in this cylinder so that it would have a perfect mesh shape of quads. How to do that using python script?

$\endgroup$

2 Answers 2

3
$\begingroup$

I found the answer, the way it is done is:

old_type = bpy.context.area.type
bpy.ops.object.mode_set(mode='EDIT')
bpy.context.area.type = 'VIEW_3D'

bpy.ops.mesh.loopcut_slide(MESH_OT_loopcut={"number_cuts":10, "smoothness":0, "falloff":'ROOT', "edge_index":1})
bpy.ops.mesh.loopcut_slide(MESH_OT_loopcut={"number_cuts":10, "smoothness":0, "falloff":'ROOT', "edge_index":0})
bpy.context.area.type = old_type 

So you should be in edit mode, and VIEW_3D context, then use the loop cut to cut the edge "edge_index"

$\endgroup$
0
$\begingroup$

crt-r should get you your horizontal cuts then use shift-Tab to snap the movement to grid. Doing this you can try and get your prefect quads

$\endgroup$
2
  • 1
    $\begingroup$ I want to do it by using python script $\endgroup$ Commented Jun 9, 2014 at 14:07
  • $\begingroup$ this might help youtube.com/watch?v=1OePNW34-z4 $\endgroup$ Commented Jun 9, 2014 at 21:15

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.