Reply To: scripting in blender – selecting a collection in blender python,

Forum Archive scripting in blender – selecting a collection in blender python, Reply To: scripting in blender – selecting a collection in blender python,

#52794
Wayne Dixon
Participant

    You can try two things.

    bpy.data.collections['YOUR_COLLECTION_NAME']

    or

    bpy.context.scene.collection.children[0] #or the index of your collection (that is the first child collection of the master scene)

    I would mess around in the python console with autocomplete to figure out the way to do what I wanted to do.

    eg – to change the name of your collection… (D is a shortcut for bpy.data in the console)

    D.collections['Collection'].name = 'Test'

    Good luck