diff options
-rw-r--r-- | add_mesh_extra_objects/add_mesh_gears.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/add_mesh_extra_objects/add_mesh_gears.py b/add_mesh_extra_objects/add_mesh_gears.py index 54081d6e..32d03fa2 100644 --- a/add_mesh_extra_objects/add_mesh_gears.py +++ b/add_mesh_extra_objects/add_mesh_gears.py @@ -675,12 +675,14 @@ class AddGear(bpy.types.Operator): base = create_mesh_object(context, verts, [], faces, "Gear") obj = base.object - # Create vertex groups from stored vertices. - tipGroup = obj.vertex_groups.new('Tips') - tipGroup.add(verts_tip, 1.0, 'ADD') + # XXX, supporting adding in editmode is move involved + if obj.mode != 'EDIT': + # Create vertex groups from stored vertices. + tipGroup = obj.vertex_groups.new('Tips') + tipGroup.add(verts_tip, 1.0, 'ADD') - valleyGroup = obj.vertex_groups.new('Valleys') - valleyGroup.add(verts_valley, 1.0, 'ADD') + valleyGroup = obj.vertex_groups.new('Valleys') + valleyGroup.add(verts_valley, 1.0, 'ADD') return {'FINISHED'} @@ -776,11 +778,13 @@ class AddWormGear(bpy.types.Operator): base = create_mesh_object(context, verts, [], faces, "Worm Gear") obj = base.object - # Create vertex groups from stored vertices. - tipGroup = obj.vertex_groups.new('Tips') - tipGroup.add(verts_tip, 1.0, 'ADD') + # XXX, supporting adding in editmode is move involved + if obj.mode != 'EDIT': + # Create vertex groups from stored vertices. + tipGroup = obj.vertex_groups.new('Tips') + tipGroup.add(verts_tip, 1.0, 'ADD') - valleyGroup = obj.vertex_groups.new('Valleys') - valleyGroup.add(verts_valley, 1.0, 'ADD') + valleyGroup = obj.vertex_groups.new('Valleys') + valleyGroup.add(verts_valley, 1.0, 'ADD') return {'FINISHED'} |