1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
21 "description": "Add loops fast",
22 "author": "Andy Davies (metalliandy)",
25 "location": "Tool Shelf",
33 This script enables the fast creation of multiple loops on a mesh
36 1)Click the FastLoop button on the Tool Shelf to activate the tool
37 2)Hover over the mesh in the general area where you would like a loop to be added
38 (shown by a highlight on the mesh)
39 3)Click once to confirm the loop placement
40 4)place the loop and then slide to fine tune its position
41 5)Repeat 1-4 if needed
42 6)Press Esc. twice to exit the tool
45 http://blenderartists.org/forum/showthread.php?t=206989
46 http://www.metalliandy.com
49 Bartius Crouch (Crouch) - http://sites.google.com/site/bartiuscrouch/
50 Dealga McArdle (zeffii) - http://www.digitalaphasia.com
53 v0.16 - Amended script for compatibility with recent API changes
54 v0.15 - Amended script meta information and button rendering code for
55 compatibility with recent API changes
56 v0.14 - Modal operator
57 v0.13 - Initial revision
61 from bpy
.types
import Operator
62 from bpy
.props
import BoolProperty
65 class OBJECT_OT_FastLoop(Operator
):
66 bl_idname
= "object_ot.fastloop"
68 bl_description
= ("Create multiple edge loops in succession\n"
69 "Runs modal until ESC is pressed twice")
71 active
= BoolProperty(
77 def poll(cls
, context
):
78 return bpy
.ops
.mesh
.loopcut_slide
.poll()
80 def modal(self
, context
, event
):
81 if event
.type == 'ESC':
82 context
.area
.header_text_set(None)
85 elif event
.type == 'LEFTMOUSE' and event
.value
== 'RELEASE':
90 bpy
.ops
.mesh
.loopcut_slide('INVOKE_DEFAULT')
91 context
.area
.header_text_set("Press ESC twice to stop FastLoop")
93 return {'RUNNING_MODAL'}
95 def invoke(self
, context
, event
):
96 context
.window_manager
.modal_handler_add(self
)
98 return {'RUNNING_MODAL'}
102 bpy
.utils
.register_module(__name__
)
107 bpy
.utils
.unregister_module(__name__
)
111 if __name__
== "__main__":