After having created a polygon in the XY plane and extruded along the Z axis, I want to subdivide it horizontally. I tried :

CreatePoly(foo) # my func
bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={}, TRANSFORM_OT_translate={"value":(0, 0, 10),
        "constraint_axis":(False, False, True), "constraint_orientation":'GLOBAL',
        "proportional_size":1, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0),
        "snap_align":False, "snap_normal":(0, 0, 0) })

Up to here all works, but then:

bpy.ops.mesh.loopcut_slide(MESH_OT_loopcut={"number_cuts":10, "smoothness":0,
   "falloff":'LINEAR', "edge_index":1, "mesh_select_mode_init":(True, False, False)}, 
   TRANSFORM_OT_edge_slide={"value":0, "single_side":False, "use_even":False, "flipped":False,
   "use_clamp":True, "mirror":False, "snap":False, "snap_target":'CLOSEST',
   "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0),
   "correct_uv":False, "release_confirm":False, "use_accurate":False})

I get:

File "/usr/share/blender/scripts/modules/bpy/ops.py", line 189, in call ret = op_call(self.idname_py(), None, kw) RuntimeError: Operator bpy.ops.mesh.loopcut_slide.poll() expected a view3d region & editmesh

What am I missing?


Your Answer

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

Browse other questions tagged or ask your own question.