Page MenuHome

bmesh.ops.contextual_create malfunctioning
Closed, ArchivedPublic

Description

--- Operating System, Graphics card ---


--- Blender version with error, and version that worked ---
error found in 2.670 r57123

--- Short description of error ---
bmesh.ops.contextual_create doesn't work properly

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
add a primitive plane, select it, go into edit mode

use the console type this in or execute this from the text editor:

import bmesh,bpy
mesh=bpy.context.active_object.data
bm=bmesh.from_edit_mesh(mesh)
bm.verts.new((1,1,1))
bm.verts.new((-1,1,1))
bm.verts.new((1,-1,1))
bm.verts.new((-1,-1,1))
bmesh.update_edit_mesh(mesh)
bmesh.ops.contextual_create(bm,[bm.verts[4],bm.verts[5],bm.verts[6],bm.verts[7]])

creates the error

TypeError: bmesh operators expect a single BMesh positional argument, all other args must be keywords

which doesn't make sense considering the 2nd argument has to be a list of bmesh objects to operate on, at least according to the API

http://www.blender.org/documentation/blender_python_api_2_67_1/bmesh.ops.html?highlight=bmesh.ops.contextual#bmesh.ops.contextual_create

I hope I made no mistakes and this is actually a bug...

Thanks!

Event Timeline

hell Max,
as i understood the message you have give the second and all following arguments its keywords except of the first one - this you have to give without its keywort in the parameter list...
like:

bmesh.ops.contextual_create(
bm,
geom=[bm.verts[4],bm.verts[5],bm.verts[6],bm.verts[7]],
mat_nr=1,
use_smooth=False
)

oops...forget my post, i did not read you message carefully... sorry.

Right, the second argument must be a keyword arg.

I checked an it works, closing.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Archived.Jul 1 2013, 3:04 AM