Skip to content
Snippets Groups Projects
Commit 134df886 authored by Bart Crouch's avatar Bart Crouch
Browse files

Fixes crash when all faces are selected.

Thanks go to Czarek Kopias for the bug report and proposing a fix.
parent 6a08ec8f
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,8 @@
bl_info = {
'name': "F2",
'author': "Bart Crouch",
'version': (1, 4, 0),
'blender': (2, 65, 9),
'version': (1, 5, 0),
'blender': (2, 66, 3),
'location': "Editmode > F",
'warning': "",
'description': "Extends the 'Make Edge/Face' functionality",
......@@ -249,8 +249,14 @@ class MeshF2(bpy.types.Operator):
bm = bmesh.from_edit_mesh(context.active_object.data)
sel = [v for v in bm.verts if v.select]
if len(sel) > 2:
if len([True for f in bm.faces if f.select]) == len(bm.faces):
# all faces selected, can't create new one
return {'CANCELLED'}
# original 'Make Edge/Face' behaviour
bpy.ops.mesh.edge_face_add()
try:
bpy.ops.mesh.edge_face_add('INVOKE_DEFAULT')
except:
pass
elif len(sel) == 1:
# single vertex selected -> mirror vertex and create new face
quad_from_vertex(bm, sel[0], context, event)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment