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 bpy.data.collections: print(coll.name) print(coll.hide_render) print(coll.hide_select) coll.hide_render = False coll.hide_select = False # deselect everything bpy.ops.object.select_all(action='DESELECT') # 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 bpy.data.objects: obj.select_set(True) if obj.name in '_.': obj.select_set(False)
Note am a dumb ass in python XD so please be gentle and give me simple answers
Thanks in advance and happy blending !