2
$\begingroup$

Can I get a list of the selected objects from Outliner, not from the scene? I want to create a script that unhides the objects selected in the Outliner: the problem is that if I try to grab the objects using bpy.context.selected_objects the hidden objects aren't included.

enter image description here

$\endgroup$
  • $\begingroup$ It would seem to me that SpaceOutliner.filter_state might be relevant, though I'm getting console errors in b2.80 that "AttributeError: type object 'SpaceOutliner' has no attribute 'filter_state'", so I'm not sure if it works. $\endgroup$ – asoftbird Nov 20 '19 at 10:12
  • $\begingroup$ I think this is for filter queries, these ones :/ $\endgroup$ – Sergey Kritskiy Nov 20 '19 at 10:21
  • $\begingroup$ blenderartists.org/t/blender-2-8-python-hide-unhide-objects/… $\endgroup$ – yhoyo Nov 20 '19 at 12:09
  • $\begingroup$ That would affect all hidden objects though, not the ones selected. $\endgroup$ – asoftbird Nov 20 '19 at 12:18
  • $\begingroup$ I've been looking through the API and can't find anything relevant. The Blender source code contains a ED_outliner_selected_objects_get() function in the ED_outliner.h library file. Would it be possible to make a C-based addon instead of Python that includes that library file and is able to use it? $\endgroup$ – asoftbird Nov 20 '19 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.