If the "Object Children" filter is enabled, we nest the object children inside
the object. If the child itself is not in the collection, it is grayed out,
connected by a dash line, and its restriction flags and contents are not shown.
If "Object Children" filter is disabled, it works as before.
Note: This is not super fast, but at least we traverse the tree only once to get the
children of an object. That said, there is a lot of loops going on here.
I could use the GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR shader, but
that would mean I would need to iterate over the tree twice (once for
each shader) - or do some bigger refactor.
Also I could not get that shader to work. This shader expects float
vertices while the current one is using integers, so converting the code
would make the dash line drawing to diverge from the regular lines even
To store the objects children I'm "borrowing" id.py_instance to store
the list with the object children. My original plan was to use id.newid
(as we do already in the outliner). However this is re-set when adding
new children, so I'm happy staying away from (I got it to work with
newid though, I just think it is not as clean as using py_instance.