diff options
Diffstat (limited to 'release/scripts/startup/bl_operators/mesh.py')
-rw-r--r-- | release/scripts/startup/bl_operators/mesh.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py index ea504d48448..be74f8dbc0e 100644 --- a/release/scripts/startup/bl_operators/mesh.py +++ b/release/scripts/startup/bl_operators/mesh.py @@ -148,3 +148,53 @@ class MeshMirrorUV(Operator): double_warn) return {'FINISHED'} + + +class MeshSelectNext(Operator): + """Select the next element (using selection order)""" + bl_idname = "mesh.select_next_item" + bl_label = "Select Next Element" + bl_options = {'REGISTER', 'UNDO'} + + @classmethod + def poll(cls, context): + return (context.mode == 'EDIT_MESH') + + def execute(self, context): + import bmesh + from .bmesh import find_adjacent + + obj = context.active_object + me = obj.data + bm = bmesh.from_edit_mesh(me) + + if find_adjacent.select_next(bm, self.report): + bm.select_flush_mode() + bmesh.update_edit_mesh(me, False) + + return {'FINISHED'} + + +class MeshSelectPrev(Operator): + """Select the next element (using selection order)""" + bl_idname = "mesh.select_prev_item" + bl_label = "Select Previous Element" + bl_options = {'REGISTER', 'UNDO'} + + @classmethod + def poll(cls, context): + return (context.mode == 'EDIT_MESH') + + def execute(self, context): + import bmesh + from .bmesh import find_adjacent + + obj = context.active_object + me = obj.data + bm = bmesh.from_edit_mesh(me) + + if find_adjacent.select_prev(bm, self.report): + bm.select_flush_mode() + bmesh.update_edit_mesh(me, False) + + return {'FINISHED'} |