# コレクションを作る 重複の場合 作らない
import bpy
# List of collection names
collection_names = [
"光時計 +y",
"光時計 -y",
"abcdefg",
"abcdefg",
"abcdefg",
"abcdefg"
]
# Function to create a new collection if it doesn't exist
def create_collection_if_not_exists(name):
if name not in bpy.data.collections:
collection = bpy.data.collections.new(name)
bpy.context.scene.collection.children.link(collection)
# Create collections
for name in collection_names:
create_collection_if_not_exists(name)