diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-15 22:30:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-15 22:30:49 +0400 |
commit | ac602142d3a50157f91d9106dfbf2b39814ac648 (patch) | |
tree | b130c17f32fdee0be2cc02904bf2564f52f65fc6 /release/scripts/startup/bl_operators/view3d.py | |
parent | cd6477eee008146c81f7963e52563277ed0b2eac (diff) |
add 'Extrude Region, Vertex Normal' to the extrude menu, equivalent of 'Extrude, Escape, Alt+S'
Diffstat (limited to 'release/scripts/startup/bl_operators/view3d.py')
-rw-r--r-- | release/scripts/startup/bl_operators/view3d.py | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py index e0b5526e220..27d2a2361a1 100644 --- a/release/scripts/startup/bl_operators/view3d.py +++ b/release/scripts/startup/bl_operators/view3d.py @@ -62,7 +62,8 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator): bl_label = "Extrude and Move on Normals" bl_idname = "view3d.edit_mesh_extrude_move_normal" - def execute(self, context): + @staticmethod + def extrude_region(context, use_vert_normals): mesh = context.object.data totface = mesh.total_face_sel @@ -70,10 +71,15 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator): #~ totvert = mesh.total_vert_sel if totface >= 1: - bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', - TRANSFORM_OT_translate={ - "constraint_orientation": 'NORMAL', - "constraint_axis": (False, False, True)}) + if use_vert_normals: + bpy.ops.mesh.extrude_region_shrink_fatten('INVOKE_REGION_WIN', + TRANSFORM_OT_shrink_fatten={}) + else: + bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', + TRANSFORM_OT_translate={ + "constraint_orientation": 'NORMAL', + "constraint_axis": (False, False, True)}) + elif totedge == 1: bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={ @@ -88,6 +94,22 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator): # and cause this one not to be freed. [#24671] return {'FINISHED'} + def execute(self, context): + return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, False) + + def invoke(self, context, event): + return self.execute(context) + + + +class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator): + "Extrude and move along individual normals" + bl_label = "Extrude and Move on Individual Normals" + bl_idname = "view3d.edit_mesh_extrude_move_shrink_fatten" + + def execute(self, context): + return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, True) + def invoke(self, context, event): return self.execute(context) |