2023年8月28日月曜日

20230828 光時計 追加 minus側







 

 

 

 

#  コレクションを作る 重複の場合 作らない

 

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)