I want to use the bevel-tool to add a face between two other faces. The bevel-tool should use the selected edge(s) as geometry.location is given via a selected edge.
This is what I have
This is what I want
Which bevel-tool should I use? http://www.blender.org/api/blender_python_api_2_75a_release/bmesh.ops.html?highlight=bmesh.ops.bevel#bmesh.ops.bevel or http://www.blender.org/api/blender_python_api_2_75a_release/bpy.ops.mesh.html?highlight=bpy.ops.mesh.bevel#bpy.ops.mesh.bevel
And how can I set a enum-value? I tried offset_type='OFFSET' but I get the error that int was expected.
Script:
import bpy, bmesh
from mathutils import Vector
obj = bpy.context.object
bm = bmesh.new()
bm.from_mesh(obj.data)
bm.verts.ensure_lookup_table()
selected_edge = None
for edge in bm.edges:
if edge.select:
selected_edge = edge
print("edge", edge)
print("selected_edge", selected_edge)
bpy.ops.object.mode_set(mode='OBJECT') # only working in object mode
faces = bmesh.ops.bevel(bm,
geom=[selected_edge],
offset=0.2,
offset_type='OFFSET',
segments=1,
profile=0.5,
vertex_only=False,
clamp_overlap=True,
material=-1)
print("faces", faces)
bm.to_mesh(obj.data)