Skip to main content
1 of 3
batFINGER
  • 85.8k
  • 10
  • 118
  • 251

Once for each collection.

Just as I was about to answer this yesterday, my internet ran out, fortunately there is a bit of a point of difference.

To do this once for all collections, would add the root scene collections to bpy.data.collections and then sort the immediate children of each.

import bpy collections = bpy.data.collections[:] collections.extend(scene.collection for scene in bpy.data.scenes) for col in collections: for c in sorted(col.children, key=lambda c: c.name): col.children.unlink(c) col.children.link(c) 
batFINGER
  • 85.8k
  • 10
  • 118
  • 251