# Unselect hidden mesh after unhide

Is it possible to unselect only the parts that were hidden, after the unhide command (AltH)? I want to keep the previous selection.

• While it's not python solution, you can use vertex group for that. Create one, assign selected vertices to it, unhide and deselect everythiing. Then, select vertices assigned to the group. – Mr Zak Jun 9 '15 at 14:32
• I did python solution which unhides all verts/faces and leave selection as it was before. pastebin.com/H4gzFYEr But i don't know how to add it to shortcut and to the addon. – mifth Jun 9 '15 at 14:37

There may be a more elegant solution, but i believe this process gives you the result you are seeking.

Select the mesh vertices you are interested in.
Invert your selection (Ctrl + I).
Unhide the hidden mesh components (Alt + H).
Invert your selection with Ctrl I again.

• very nice work around. UVed – David Jun 9 '15 at 15:11

Here is an addon I made a couple years ago which makes this functionality appear in the toolbox as Reveal Hidden, deselected, updated for Blender 2.80:

bl_info = {
"name": "Reveal Hidden, deselected",
"description": "Unhide/Reveal hidden geometry without it getting added to selection.",
"author": "Zyl",
"version": (1, 1),
"blender": (2, 80, 0),
"location": "Toolbox > Reveal Hidden, deselected",
"category": "Mesh"
}

import bpy
import bmesh

class RevealHiddenDeselected(bpy.types.Operator):
"""Unhide/Reveal hidden geometry without it getting added to selection."""
bl_idname = "mesh.reveal_hidden_deselected"
bl_label = "Reveal Hidden, deselected"
bl_options = { 'REGISTER', 'UNDO' }

def execute(self, context):
me = context.active_object.data
if me is None:
return { 'FINISHED' }
bm = None
inedit = me.is_editmode
if not inedit:
print("Must be in edit mode to unhide w/o selecting.")
return { 'FINISHED' }
else:
bm = bmesh.from_edit_mesh(me)
if bm is None:
return { 'FINISHED' }
for v in bm.verts:
v.hide_set(False)
for e in bm.edges:
e.hide_set(False)
for f in bm.faces:
f.hide_set(False)
bmesh.update_edit_mesh(me, False, False)
return { 'FINISHED' }

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

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

• Tested, works great. Thanks for sharing. Could it be possible to provide a link to th 2.79 version? – Leander Jul 24 '19 at 19:47
• Try this for pre-2.80: pastebin.com/ycPwcWs4 – Zyl Jul 24 '19 at 20:02