Blender 3.2 how to find unselectable ob

is there some way to find unselectable ob in outliner

or may be some short script
able to select these objects

thanks
happy bl

how does it allow to see only the unselectables ob ?

the arrow enable selection in viewport or not !

thanks
happy bl

If you want to select all unselected objects only just do A (select all), then do Ctrl + I to invert selection. Only originally unselected objects should be left selected after the last operation.

Yes- when the arrow is white, objects are selectable

After rereading your initial post, you want to find unselectable objects, not unselected objects (my mistake). Here’s a script that’ll print the name of any objects that have their unselectable settings enabled.

Unselectable Icons Example

How to show unselectable icons if you don’t see them in the Outliner

Script

import bpy

for c in bpy.data.collections:
    for o in c.all_objects:
        if o.hide_select:
            print(o.name)

A (select all), then do Ctrl + I

that one does not really work
cause you cannot select unselectable one

i taught there was a way from the outlitern
guess there was not

for script

that one does not show names of unselected object in 3.2

is it possible to show that object in outliner too !

thanks
happy bl

Done. This script will output all scene objects that are not selected in the Outliner.

import, bpy

ALL_OBJECTS = []
SELECTED_OBJECTS = []

# Get all scene objects + selected objects in Outliner
for w in bpy.context.window_manager.windows:
    for a in w.screen.areas:
        if a.type == "OUTLINER":
            with bpy.context.temp_override(window=w, area=a):
                for c in bpy.data.collections:
                    for o in c.all_objects:
                        ALL_OBJECTS.append(o)
                for item in bpy.context.selected_ids:
                    if item.bl_rna.identifier == "Object":
                        SELECTED_OBJECTS.append(bpy.data.objects[str(item.name)])

# Remove duplicate strings, then output final list names
d = [*set(ALL_OBJECTS)]
for a in d:
    if a not in SELECTED_OBJECTS:
        print(a.name)

still need the first script to work on unselectable ob

thanks
happy bl

Like this?

import bpy

SELECTABLE_OBJECTS = []
ALL_OBJECTS = []
SELECTED_OBJECTS = []

def find_if_selectable():

    # Get all unselected objects
    for c1 in bpy.data.collections:
        for o1 in c1.all_objects:
            if o1.hide_select:
                SELECTABLE_OBJECTS.append(o1)
       
    # Remove duplicate strings, then output final list names
    d1 = [*set(SELECTABLE_OBJECTS)]
    for a1 in d1:
        print("Unselectable object: " + a1.name)
                
def find_all_selectable():

    # Get all scene objects + selected objects in Outliner
    for w in bpy.context.window_manager.windows:
        for a in w.screen.areas:
            if a.type == "OUTLINER":
                with bpy.context.temp_override(window=w, area=a):
                    for c2 in bpy.data.collections:
                        for o2 in c2.all_objects:
                            ALL_OBJECTS.append(o2)
                    for item in bpy.context.selected_ids:
                        if item.bl_rna.identifier == "Object":
                            SELECTED_OBJECTS.append(bpy.data.objects[str(item.name)])

    # Remove duplicate strings, then output final list names
    d2 = [*set(ALL_OBJECTS)]
    for a2 in d2:
        if a2 not in SELECTED_OBJECTS:
            print("Unselected object: " + a2.name)
    
find_if_selectable()
find_all_selectable()

main goal was the ones that cannot be selected in the viewport

note:
if you have let say 500 objects
and have like 5 unselectable in viewport

it is hard to find the names of these objects in the outliner
cause cannot see name in viewport → not selectable

so would make it easier to list these with their names
and be able to quickly re enable the selection in the outliner

thanks
happy bl

But this is what my find_all_selectable function does though. :slightly_smiling_face: Perhaps I should have clarified that more. If the objects aren’t visible in the Outliner, type in the Outliner filter box.

find_all_selectable
will print names of all ob
so if you have 500 that is list of 500 names

what do you type in the outliner to find the unselectable ones in viewport?

thanks
happy bl

Nope. It’ll print all objects that are unselectable, thanks to line if o1.hide_select: - this line checks if a object marked unselectable. Did you try my script?

i have only one selected collection
after running your last script
it shows like over 100 unselectable objects

and in outliner i have may be 2 or 3 unsectable ob

so not certain why ?

thanks
happy bl

in viewport i have one ob = cube which in outliner is unselectable
and cannot select it in viewport
see pic

there might be other ob not selectable too
that is why i would like a list for these with name

thanks
happy bl

Those prints are froming from the find_all_selectable() function - comment it out for now.
Leave find_if_selectable() uncommented - this is what you want.

i run script using the script tab at top
and the script outliner does not showob selectable or not
how come ?

have to find line for the find_if_selectable()

thanks
happy bl

what is this list
never seen that one before

d2 = [*set(ALL_OBJECTS)]

i tried to comment line for all select def
and i get nothing form the other function

thanks

happy bl

I posted it above… maybe you didn’t copy all of my code on accident?

https://blenderartists.org/t/blender-3-2-how-to-find-unselectable-ob/1395763/10

Because of the many for in loops, there’s a lot of generated duplicate names and makes it hard to discern which names are in output, so I implemented these lines to remove duplicate strings.