Operating system: Linux-4.15.0-88-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 435.21
Broken: version: 2.82 (sub 7), branch: master, commit date: 2020-03-12 05:06, hash: rB375c7dc4caf4
Short description of error
Select Hierarchy will throw the following error when a child object is not linked to the scene.
Traceback (most recent call last): File "/opt/blender 2.82a/2.82/scripts/startup/bl_operators/object.py", line 217, in execute obj.select_set(True) RuntimeError: Error: Object 'child2' can't be selected because it is not in View Layer 'View Layer'!
Curiously it doesn't seem to happen when the object is unlinked from the Outliner, only when done via python. Updating the depsgraph and/or view layer seems to have no effect either.
Selecting the child via Select Grouped works fine.
Exact steps for others to reproduce the error
- open the blend and run the script to unlink the selected child object
- run the Select Hierarchy tool (in Child direction)