Collection show

Hi all

As i recently migrate definetely to 2.9, i’m rewriting my small script to export the scene from blender to unity3D.

What i want to do is export everything ( even in hidden collections ) EXCEPT:

  • objects with the name starting with a . or a _
  • objects that are linked

My problem come from collections.

I got a cube in a collection. This collection is hidden and i cannot unhide it in python.

Here’s what i do:

import bpy.ops
import bpy

# 1st of all show/activate all collections
for coll in
    coll.hide_render = False
    coll.hide_select = False

# deselect everything

# then parse all objects list.
# activate the current one and only inactivate it if is has a '_' or '.' ath the start of its name.
# also inactivate it if it's a linked object :-)
for obj in
    if[0] in '_.':

Note am a dumb ass in python XD so please be gentle and give me simple answers :stuck_out_tongue:
Thanks in advance and happy blending !

I reply to myself…

Strangely this does nothing in blender, but the object in the hidden collection is selected and then exported to unity3D.

Then i got what i need.

I got another question though. About linked objects:

In 2.79 we could test an object is linked with:

            the_obj =[]
            if the_obj.library != None:
       = False 

This do not work in 2.9

Any help please ?

Thanks and happy blending !

Okay… i’m definetely too stoopid :confused:

Those 3 lines work fine is i replace the with obj.select_set(False)


Now my script works fine and i will update the old topic talking about this:

Happy blending !