球体 36個 円周 順番 発射
# コレクションを作成 import bpy collection_name = "球体 順番発射" if collection_name not in bpy.data.collections: zionad_collection = bpy.data.collections.new(collection_name) bpy.context.scene.collection.children.link(zionad_collection) else: zionad_collection = bpy.data.collections[collection_name] import bpy import math import mathutils # 移動速度の調整 zion_speed = 0.2 # パラメーター radius = 2 num_spheres = 36 sphere_radius = 0.1 z = -2 # 円周上に球体を配置 for i in range(num_spheres): angle = 2 * math.pi * i / num_spheres x = radius * math.cos(angle) y = radius * math.sin(angle) # 球体を作成 bpy.ops.mesh.primitive_uv_sphere_add(radius=sphere_radius, enter_editmode=False, location=(x, y, z)) # オブジェクトを取得 obj = bpy.context.object # オブジェクト名 bpy.context.object.name = "zion_ball" # アニメーションを作成 obj.location = (x, y, z) obj.keyframe_insert(data_path="location", frame=i * 3 / zion_speed + 1) obj.location = (0, 0, 0) obj.