EDIT. AN IMPROVED VERSION BY CAMBO IS AVAILABLE DOWN THE PAGE. VISUAL CLUES, BETTER GESTURE DETECTION AND MORE!
Blender Mouse Gesture system has been around for years I think, but its funcionality is very limited. I manage to create new gestures in Python that override the blender original ones. I did this as an experiment and it amazed me that worked, specially since I´m a terrible coder
If you like gestures or you like to use your mouse, give it a try. Testing is also needed by I managed to do a full session modeling without troubles. It´s kinda a strange hack using new features of bphyton so no guarantees.
It´s very usefull if you model extruding a lot… you know… extrude, scale, grab extrude rotate extrude and so on
Get the file here http://www.webfilehost.com/index.php?mode=viewupload&id=1416
[b]To use: Open the script in a text window, or just copy and paste into blender. Then activate it in the View -> Space Handlers Scripts menu in the 3D View.
Hope you like this. Feedback Welcome. Mirror the file if you want (I have no hosting right now)
# SPACEHANDLER.VIEW3D.EVENT
import Blender
from Blender import Window, Draw, sys
# New Mouse Gestures v0.1 for Blender
# by Mariano Hidalgo a.k.a uselessdreamer
#
# Feel free to improve, modify or just ignore this awfull code. I SUCK at math :D
#
# To use load the script in a Text Window and then activate it
# in the View -> Space Handlers Scripts menu in the 3D View.
# For simple customization you just search for EKEY, RKEY, SKEY or whatever key
# you want to change and replace for the new one (change only mode specific keys if
# you dont know python enough, ie: do not change scale(S) for separate(P) since it
# won´t work in object mode). Also don´t delete the fist line, it will not work without it.
#
# Note if you want to customize that some keys will not work (SPACEBAR, I, TAB and some others)
#
#
# Drag Up = Extrude (E) or Move To Layer (M)
# Drag Down = Rotate (R)
# Drag Left = Scale (S)
# Drag Right = Grab (G)
# Drag Up Left = Undo (U) or (CTRL Z)
# Drag Up Right = Redo (U) or (CTRL Y)
# Drag Down Left = Select All (A)
# Drag Down Right = Delete (X)
#
#
evt = Blender.event
if evt == Draw.LEFTMOUSE:
# Gather info about which 3D Window is generating the event
# Grab it´s size and location on the screen
winId = Window.GetAreaID()
winSize = Window.GetAreaSize()
winData = Window.GetScreenInfo()
width = winSize[0]
height = winSize[1]
for win in winData:
if win["id"] == winId:
xmin = win["vertices"][0]
ymin = win["vertices"][1]
xmax = win["vertices"][2]
ymax = win["vertices"][3]
# Grab old and new Mouse Position
# Not sure about this sys.sleep trick...
# There should be a better way of doing this :/
clickX = Window.GetMouseCoords()[0]
clickY = Window.GetMouseCoords()[1]
sys.sleep(200) # Tweak this for debbuging funcionality if you want
clickNewX = Window.GetMouseCoords()[0]
clickNewY = Window.GetMouseCoords()[1]
# Put here what you want to do in case of Straight Drag Up
if (clickNewY - clickY) > 30 and (clickNewX - clickX) < 30 and (clickNewX - clickX) > -30:
if Window.EditMode():
Window.QAdd(winId,Draw.EKEY,1) # Change KeyPress Here for EditMode
Window.QHandle(winId)
Blender.event = None
else:
Window.QAdd(winId,Draw.MKEY,1) # Change KeyPress Here for ObjectMode
Window.QHandle(winId)
Blender.event = None
# Put here what you want to do in case of Straight Drag Down
if (clickNewY - clickY) < -30 and (clickNewX - clickX) < 30 and (clickNewX - clickX) > -30:
Window.QAdd(winId,Draw.RKEY,1) # Change KeyPress Here
Window.QHandle(winId)
Blender.event = None
# Put here what you want to do in case of Straight Drag Left
if (clickNewX - clickX) < -30 and (clickNewY - clickY) < 30 and (clickNewY - clickY) > -30:
Window.QAdd(winId,Draw.SKEY,1) # Change KeyPress Here
Window.QHandle(winId)
Blender.event = None
# Put here what you want to do in case of Straight Drag Right
if (clickNewX - clickX) > 30 and (clickNewY - clickY) < 30 and (clickNewY - clickY) > -30:
Window.QAdd(winId,Draw.GKEY,1) # Change KeyPress Here
Window.QHandle(winId)
Blender.event = None
# Put here what you want to do in case of Straight Drag Up Left
if (clickNewY - clickY) > 30 and (clickNewX - clickX) < -60 and (clickNewX - clickX) < 30:
if Window.EditMode():
Window.QAdd(winId,Draw.UKEY,1) # Change KeyPress Here for EditMode
Window.QHandle(winId)
Blender.event = None
else:
Window.SetKeyQualifiers(48) # This is to use SHIFT modifier (3=SHIFT | 48=CTRL | 12=ALT)
Window.QAdd(winId,Draw.ZKEY,1) # Change KeyPress Here for ObjectMode
Window.QHandle(winId)
Blender.event = None
Window.SetKeyQualifiers(0) # Release the modifier keys!!!
# Put here what you want to do in case of Straight Drag Up Right
if (clickNewY - clickY) > 30 and (clickNewX - clickX) > 30 and (clickNewX - clickX) > -60:
if Window.EditMode():
Window.SetKeyQualifiers(3) # This is to use SHIFT modifier (3=SHIFT | 48=CTRL | 12=ALT)
Window.QAdd(winId,Draw.UKEY,1) # Change KeyPress Here for EditMode
Window.QHandle(winId)
Blender.event = None
Window.SetKeyQualifiers(0) # Release the modifier keys!!!
else:
Window.SetKeyQualifiers(48) # This is to use CTRL modifier (3=SHIFT | 48=CTRL | 12=ALT)
Window.SetKeyQualifiers(3) # This is to use SHIFT modifier (3=SHIFT | 48=CTRL | 12=ALT)
Window.QAdd(winId,Draw.ZKEY,1) # Change KeyPress Here for ObjectMode
Window.QHandle(winId)
Blender.event = None
Window.SetKeyQualifiers(0) # Release the modifier keys!!!
# Put here what you want to do in case of Straight Drag Down Right
if (clickNewY - clickY) < -30 and (clickNewX - clickX) > 30 and (clickNewX - clickX) > -60:
Window.QAdd(winId,Draw.XKEY,1) # Change KeyPress Here
Window.QHandle(winId)
Blender.event = None
# Put here what you want to do in case of Straight Drag Down Left
if (clickNewY - clickY) < -30 and (clickNewX - clickX) < -60 and (clickNewX - clickX) < 30:
Window.QAdd(winId,Draw.AKEY,1) # Change KeyPress Here
Window.QHandle(winId)
Blender.event = None
Draw.Redraw()