1, 2 and 3 keys are still destructive in object mode

PROBLEM

  • Pressing 1, 2 and 3 toggles between vertex, edge and face selection in edit mode. This is used all the time.
  • Pressing 1, 2 and 3 isolates a collection in object mode. This mistake is done all the time…

If you have a lot of collections, some visible, some hidden, accidentally pressing a number key while in object mode wastes a lot of your time.


SOLUTION
Pressing 1 twice in object mode should return the visibility state to where it was before pressing the button.

(Note: This is very similar to how in 2.79 you could contol click to isolate a hierarchy in the outliner, and then click again to revert to the previous visibility state. This was initially removed in 2.8 and replaced with a destructive click, only to be brought back to a toggle after users complained.)

15 Likes

So… is the LTS release going to still have destructive toggles in object mode?

1 Like

OMG yes please, this current behavior is infuriating! I still have no clue what exactly it does. There doesn’t seem to be any method or reason to what determines which groups get shown or hidden.

3 Likes

Blender has no concept of what the previous visibility state was.

IMO, the use of those number keys works poorly now with nested infinite collections - we could just NOT do that. See the IC keymap, which just doesn’t have this problem.

3 Likes

I ran into this many times recently - pressed number key and hidden all other collections. I’m not sure what causes such behaviour on human side, maybe some muscle memory patterns in brain that persist between modes. Anyway, probably it might be better to remove collection isolation hotkeys.

I swear I read somewhere that this was finally about to change, but I just accidentally, again, managed to do this in the latest nightly 2.9 build… :disappointed:

For now, go to the keymap preferences and delete every “hide collection” entry bound to 1-0.

1 Like

Just found this thread. I made a post about this some time ago as well:


Feel free to chat about this there as well. I too feel it is a left over mechanic that should be re-thought.

That’s a very good idea!

first thing I do when starting new shortcut setup in newer blender versions is to disable [0-9] collection visibility shortcuts

This operation should be reviewed, either by having it off by default and assiging it manually via right click on collection or simply having better icon indication on which collections will shown if user presses number keys
image

3 Likes

I do it all the time by striking the 1 key by mistake instead of the Q. And it is infuriating. Thank God for ctrl-Z though.

I kind of like it, this idea of bookmarking collections!

This is killing me! And it isn’t even a toggle in 2.91, and it turns off internal collections as well.
So best you can do is switch to the collection which has the most collections, and then go through the rest manually turning them back on.

1 Like

Maybe this can be handled by switching to a temporary or special view layer. That way you can easily switch back to your own/previous view.

I’ve made a little script that could be useful for those that do not use the 1-3 keys to set collections visibility.
It works the same way in object mode as in edit mode. In object mode, enters edit mode and selects vertex, edge, face

bl_info = {
    "name": "AR Select",
    "category": "Object",
    "blender": (2, 80, 0),
    "author": "AR d-V-b",
}

import bpy


class ARSelect(bpy.types.Operator):
    """ARSelect"""
    bl_idname = 'object.ar_select'
    bl_label = 'Edit Select (AR)'
    bl_options = {'UNDO'} #'REGISTER'
    m_select_type: bpy.props.EnumProperty(
        name = 'Mesh Select Type',
        items = [
            ('VERT', 'Vertex', 'Select Vertex'),
            ('EDGE', 'Edge', 'Select Edge'),
            ('FACE', 'Face', 'Select Face'),
            ]
        )

    g_select_type : bpy.props.EnumProperty(
        name = 'GP Select Type',
        items = [
            ('0', 'Point', 'Select Point'),
            ('1', 'Stroke', 'Select Stroke'),
            ('2', 'Segment', 'Select Segment'),     
            ]
        )


    def execute(self, context):
        if bpy.context.object.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_mode(
                use_extend=False,
                use_expand=False,
                type=self.m_select_type)

        elif bpy.context.object.type == 'GPENCIL':
            bpy.ops.gpencil.editmode_toggle()
            bpy.ops.gpencil.selectmode_toggle(mode=int(self.g_select_type))
        else:
            return {'CANCELLED'}

        return {'FINISHED'}


_keys = []

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

    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')

    kmi = km.keymap_items.new(ARSelect.bl_idname, 'ONE', 'PRESS', ctrl=False, shift=False)
    kmi.properties.m_select_type = 'VERT'
    kmi.properties.g_select_type = '0'

    kmi = km.keymap_items.new(ARSelect.bl_idname, 'TWO', 'PRESS', ctrl=False, shift=False)
    kmi.properties.m_select_type = 'EDGE'
    kmi.properties.g_select_type = '1'

    kmi = km.keymap_items.new(ARSelect.bl_idname, 'THREE', 'PRESS', ctrl=False, shift=False)
    kmi.properties.m_select_type = 'FACE'
    kmi.properties.g_select_type = '2'

    _keys.append(km)


def unregister():
    bpy.utils.unregister_class(ARSelect)
    wm = bpy.context.window_manager
    for km in _keys:
        wm.keyconfigs.addon.keymaps.remove(km)
    del _keys[:]


if __name__ == "__main__":
    register()

3 Likes

This feature actually is broken since 2.8, but it is easy to repair with a simple change in the concept. Instead of put a hotkey to the collections turn on/off the visibility by groups using the color of the collection

imagen

nocolor? 1
colors? 2-9
Show all collections? 0

If you don’t use this and pulse 2 or 3 by error only need to pulse 1 to recover your visibility, if you want to use you have all the potential of the old system. Also allow to have a better order in the scene

1 Like

How do you implement scripts?

I think your solution is awsome

If there was a concept of ‘Groups’ inside blender, the 1, 2, and 3, keys in object mode could toggle between selecting objects, parents of objects, and groups.

edit: didn’t mean to reply to SR_Wild

Copy the script to a .py file for example “set123.py” then install it like any other addon.
Edit > Preferences > Add-ons > install

Why does this behavior even exist? The solution isn’t to make it more complex, but to remove it altogether. There are just too many high-usage keys in close proximity to 1, 2, 3 for them to perform this sort of irreversible behavior. You cannot undo to return to the previous state, you have to manually go through each item that has been hidden and show it. It’s too close to Rename (F2) and Mode (Tab); arguably Extrude (E) and Rotate (R) as well, but those are edit mode so 1, 2, 3 are good there as they change the selection type; also tilde (useful for positioning camera). You could keep it optional, but it’s most likely to waste time if you use shortcut keys often, and if you don’t, then you don’t need those numbers to be shortcuts because you don’t use them.

2 Likes