[PYTHON] [Blender] Know the selection status of hidden objects in the outliner

It seems that the selected state cannot be grasped with the following command when it is hidden like the image.

bpy.context.selected_objects

キャプチャ.JPG

Instead, it seems that there is no choice but to switch to the display state and then hide it.

import bpy
obj1 = bpy.data.objects['Cube.003']
obj1.hide_viewport = False
s = bpy.context.selected_objects
print(s)
obj1.hide_viewport = True

Hmm ...

Blender2.8 Personal notes

Recommended Posts

[Blender] Know the selection status of hidden objects in the outliner
Visualized the usage status of the sink in the company
How to know the current directory in Python in Blender
[Blender] How to dynamically set the selection of EnumProperty
Print the name of the object directly under the object specified in Blender
Equivalence of objects in Python
Implemented the algorithm of "Algorithm Picture Book" in Python3 (selection sort)
How to know the internal structure of an object in Python
I want to know the population of each country in the world.
The story of participating in AtCoder
The story of the "hole" in the file
Examine the object's class in python
The meaning of ".object" in Django
Visualize the response status of the census 2020
How to compare if the contents of the objects in scipy.sparse.csr_matrix are the same
Look up the names and data of free variables in function objects
Display the status of COVID 19 infection in Japan with Splunk (GitHub version)
[Understanding in 3 minutes] The beginning of Linux
Check the behavior of destructor in Python
The story of an error in PyOCR
Implement part of the process in C ++
Just print the selected object in Blender
I didn't know the basics of Python
The result of installing python in Anaconda
Let's claim the possibility of pyenv-virtualenv in 2021
I wrote the selection sort in C
The basics of running NoxPlayer in Python
In search of the fastest FizzBuzz in Python
Status of each Python processing system in 2020
Analyze the usage status of the contact confirmation application (COCOA) posted in "Image" / Tesseract
Visualization of the firing state of the hidden layer of the model learned in the TensorFlow MNIST tutorial