It seems that the selected state cannot be grasped with the following command when it is hidden like the image.
bpy.context.selected_objects
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