scripting in blender – selecting a collection in blender python,

Forum Archive scripting in blender – selecting a collection in blender python,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11236
    mawgav
    Participant

      hi, I am looking for a way to select a specific collection and manipulate it, i.e. not only read-only. I’m using blender 2.81a – I’m new to scripting and have benn trying things out for three days, but it all comes to nothing. I’d be very grateful for a way

      #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

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The topic ‘scripting in blender – selecting a collection in blender python,’ is closed to new replies.