Hotkeys for activating the transformation manipulators?

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
cseder
Posts: 0
Joined: Fri Jun 01, 2012 11:13 am
Location: Terra Incognita

Hotkeys for activating the transformation manipulators?

Post by cseder » Mon Jun 04, 2012 10:15 pm

Hello there!
I've just started using Blender, coming from a Maya background.
I'm used to using the Manipulators for Scale/Rotate/Move.
I know that I can use the G, S, R hotkeys for the interactive tools in Blender, but it is not what I like in all situations.
Now I need to use the tool buttons in the 3d-view header to select the different manipulators, but I would really want some hotkeys for activating them instead!

How can tis be accomplished?

Another thing I'm wondering about is how to convert a selection.
(I have a loop of vertices and would want to convert it to a polygon selection as an example.)

Help is highly appreciated!
Remember, the time is NOW!

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Mon Jun 04, 2012 10:42 pm

You can edit hotkeys in User prefs > Input

about selections:
dunno what you exactly want to do.

if you select all vertices of a face, it will be automatically a face selection (actually vertex + edge + face selection)

you can change selection mode to face if you want to just keep faces selected, from which you had all vertices selected (will deselect edges and unconnected vertices for instance)

or you might wanna do this:

select vertices all directly connected by edges, menu Select > Select Loop inner-region
I'm sitting, waiting, wishing, building Blender in superstition...

cseder
Posts: 0
Joined: Fri Jun 01, 2012 11:13 am
Location: Terra Incognita

Post by cseder » Tue Jun 05, 2012 12:35 am

It's just that you can't set a hotkey for changing the manipulators.
But I found this:
http://wiki.blender.org/index.php/Exten ... lator_Menu

This would do what I want, but when I try to install it in 2.63a on Mac64 it does not show up in the addon list in user prefs...
:?
Remember, the time is NOW!

cseder
Posts: 0
Joined: Fri Jun 01, 2012 11:13 am
Location: Terra Incognita

Post by cseder » Tue Jun 05, 2012 1:10 am

When I run the script in the console I get this:
Traceback (most recent call last):
File "/Text", line 179, in <module>
File "/Text", line 156, in register
TypeError: 'builtin_function_or_method' object is not iterable

So I guess I have to learn some Python and fix this up... :roll:
Remember, the time is NOW!

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Tue Jun 05, 2012 3:12 am

that one is for Blender 2.5x

I wrote a rough operator, which registers hotkeys

Code: Select all

import bpy

bl_info = {
    "name": "Manipulator Hotkeys",
    "description": "Bind manipulator modes to keys",
    "author": "CoDEmanX",
    "version": (0, 1),
    "warning": "Rougly written, hope it works.",
    "category": "3D View"
    }


class VIEW3D_OT_manipulator_set(bpy.types.Operator):
    '''Change manipulator mode(s) in 3D View space'''
    bl_idname = "view3d.manipulator_rotate"
    bl_label = "Manipulator Set Mode"

    mode = bpy.props.BoolVectorProperty(name="Mode", default=(True, False, False))

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        for a in context.screen.areas:
            if a.type == 'VIEW_3D':
                for s in a.spaces:
                    if s.type == 'VIEW_3D':
                        s.show_manipulator = True
                        s.use_manipulator_translate = self.mode[0]
                        s.use_manipulator_rotate = self.mode[1]
                        s.use_manipulator_scale = self.mode[2]
        
        return {'FINISHED'}


def register():
    bpy.utils.register_class(VIEW3D_OT_manipulator_set)

    kc = bpy.context.window_manager.keyconfigs.addon
    if kc:
        km = kc.keymaps.new(name="3D View", space_type="VIEW_3D")

        # TODO: Find better hotkeys
        kmi = km.keymap_items.new('view3d.manipulator_rotate', 'NUMPAD_9', 'PRESS')
        kmi = km.keymap_items.new('view3d.manipulator_rotate', 'NUMPAD_9', 'PRESS', ctrl=True)
        kmi.properties.mode = (False, True, False)
        kmi = km.keymap_items.new('view3d.manipulator_rotate', 'NUMPAD_9', 'PRESS', alt=True)
        kmi.properties.mode = (False, False, True)

def unregister():
    bpy.utils.unregister_class(VIEW3D_OT_manipulator_set)

    kc = bpy.context.window_manager.keyconfigs.addon
    if kc:
        km = kc.keymaps["3D View"]
        for kmi in km.keymap_items:
            if kmi.idname == 'view3d.manipulator_rotate':
                #if kmi.properties.name == "VIEW3D_OT_manipulator_set":
                km.keymap_items.remove(kmi)
                #break
                
if __name__ == "__main__":
    register()
save that to your addon path as something like space_view3d_manipulator_set.py

Default keys:
numpad 9 = translate
Ctrl + numpad 9 = rotate
Alt + numpad 9 = scale

is this what you wanted?
I'm sitting, waiting, wishing, building Blender in superstition...

cseder
Posts: 0
Joined: Fri Jun 01, 2012 11:13 am
Location: Terra Incognita

Post by cseder » Tue Jun 05, 2012 5:15 pm

Thanks!

Absolutely what I want. :D

Very nice...
Remember, the time is NOW!

cseder
Posts: 0
Joined: Fri Jun 01, 2012 11:13 am
Location: Terra Incognita

Post by cseder » Tue Jun 05, 2012 5:21 pm

The only thing I would want to be different is that I would like it to toggle through the three modes using the same hotkey, but I'll figure that one out myself! ;-)

Thanks again!
Remember, the time is NOW!

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Tue Jun 05, 2012 8:05 pm

you're welcome :)

try yourself, then compare with mine :D

http://www.pasteall.org/32635/python

Bound to Shift + Numpad Minus
I'm sitting, waiting, wishing, building Blender in superstition...

cseder
Posts: 0
Joined: Fri Jun 01, 2012 11:13 am
Location: Terra Incognita

Post by cseder » Tue Jun 05, 2012 8:06 pm

CoDEmanX wrote:you're welcome :)

try yourself, then compare with mine :D

http://www.pasteall.org/32635/python

Bound to Shift + Numpad Minus
Thank you very much Sir!

Appreciated.
Remember, the time is NOW!

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Wed Jun 06, 2012 2:02 am

I changed it to Alt + Middle Click (scrollwheel) in user prefs > input and it's great, 'cause you don't have to use both hands on keyboard for the combination, but keep right hand on mouse and left hand on keyboard!
I'm sitting, waiting, wishing, building Blender in superstition...

cseder
Posts: 0
Joined: Fri Jun 01, 2012 11:13 am
Location: Terra Incognita

Post by cseder » Wed Jun 06, 2012 2:36 am

I set it to Alt + q
So it is easy with the left hand on the keyboard!

Works like a charm! :D
Remember, the time is NOW!

dfxa
Posts: 0
Joined: Thu Aug 22, 2013 5:47 am

This script does not seem to work in 2.68

Post by dfxa » Thu Aug 22, 2013 5:51 am

How can I get this script to work in 2.68? It worked fine in 2.67, but broke immediately after I upgraded to 2.68. Any Ideas guys?

Post Reply