I want this to automatically go into a bevel like ctrl + B at the end but its not working does anyone know a fix for this, i tried over-riding the context but still not working
import bpyfrom bpy.types import Menu
# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)
win = bpy.context.window
scr = win.screen
areas3d = [area for area in scr.areas if area.type == 'PROPERTIES']
region = [region for region in areas3d[0].regions if region.type == 'WINDOW']
override = {'window': win,
'screen': scr,
'area': areas3d,
'region': region[0],
}
class VIEW3D_PIE_template(Menu):
# label is displayed at the center of the pie menu.
bl_label = "Select Mode"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
# operator_enum will just spread all available options
# for the type enum of the operator on the pie
pie.operator("c.bevel", "type")
class CBevel(bpy.types.Operator):
bl_label = "Bevel with smooth shading and scaling"
bl_idname = "c.bevel"
def execute(self, context):
bpy.ops.object.editmode_toggle()
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.select_similar(type='DIR', threshold=0.01)
bpy.ops.mesh.bevel(override)
return {'FINISHED'}
def register():
bpy.utils.register_class(VIEW3D_PIE_template)
bpy.utils.register_class(CBevel)
def unregister():
bpy.utils.unregister_class(VIEW3D_PIE_template)
bpy.utils.unregister_class(CBevel)
if __name__ == "__main__":
register()
bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")