コレクション名 日本語で
作って
" Z=-1”
" Z=0”
" Z=+1”
" Z=+5”
# 球体の半径
sphere_radius = 0.1
" Z=-1”
" Z=0”
" Z=+1”
" Z=+5”
Zの位置に
y=0で
X=-1
X=0
X=+1
合計 12個の球体作って
名前は X=-1なら ”左”連番で
X=0 なら ”中央”
X=1なら ”右”
" Z=ー5” にも 作って
import bpy
# 正方形のサイズと中心位置のリスト
squares = [
{"size": 2, "location": (0, 0, 5)},
{"size": 2, "location": (0, 0, 1)},
{"size": 2, "location": (0, 0, 0)},
{"size": 2, "location": (0, 0, -1)}
]
# 球体の半径
sphere_radius = 0.1
# 正方形を作成する関数
def create_square(size, location):
bpy.ops.mesh.primitive_plane_add(size=size, location=location)
# 球体を作成する関数
def create_sphere(radius, location, name):
bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=location)
bpy.context.active_object.name = name
# 正方形と球体を作成
for i, square_data in enumerate(squares):
create_square(square_data["size"], square_data["location"])
create_sphere(sphere_radius, square_data["location"], f"Center_{i}")
# 左側に球体を作成
left_location = (square_data["location"][0] - 1, square_data["location"][1], square_data["location"][2])
create_sphere(sphere_radius, left_location, f"Left_{i}")
# 右側に球体を作成
right_location = (square_data["location"][0] + 1, square_data["location"][1], square_data["location"][2])
create_sphere(sphere_radius, right_location, f"Right_{i}")
import bpy
# 正方形のサイズと中心位置のリスト
squares = [
{"size": 2, "location": (0, 0, 5)},
{"size": 2, "location": (0, 0, 1)},
{"size": 2, "location": (0, 0, 0)},
{"size": 2, "location": (0, 0, -1)}
]
# 球体の半径
sphere_radius = 0.1
# 正方形を作成する関数
def create_square(size, location):
bpy.ops.mesh.primitive_plane_add(size=size, location=location)
# 球体を作成する関数
def create_sphere(radius, location, name):
bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=location)
bpy.context.active_object.name = name
# 正方形と球体を作成
for i, square_data in enumerate(squares):
create_square(square_data["size"], square_data["location"])
create_sphere(sphere_radius, square_data["location"], f"Center_{i}")
# 左側に球体を作成
left_location = (square_data["location"][0] - 1, square_data["location"][1], square_data["location"][2])
create_sphere(sphere_radius, left_location, f"Left_{i}")
# 右側に球体を作成
right_location = (square_data["location"][0] + 1, square_data["location"][1], square_data["location"][2])
create_sphere(sphere_radius, right_location, f"Right_{i}")
import bpy
# 正方形のサイズと中心位置のリスト
squares = [
{"size": 2, "location": (0, 0, 5)},
{"size": 2, "location": (0, 0, 1)},
{"size": 2, "location": (0, 0, 0)},
{"size": 2, "location": (0, 0, -1)}
]
# 球体の半径
sphere_radius = 0.1
# 正方形を作成する関数
def create_square(size, location):
bpy.ops.mesh.primitive_plane_add(size=size, location=location)
# 球体を作成する関数
def create_sphere(radius, location, name):
bpy.ops.mesh.primitive_uv_sphere_add(radius=radius, location=location)
bpy.context.active_object.name = name
# 正方形と球体を作成
for i, square_data in enumerate(squares):
create_square(square_data["size"], square_data["location"])
create_sphere(sphere_radius, square_data["location"], f"Center_{i}")
# 左側に球体を作成
left_location = (square_data["location"][0] - 1, square_data["location"][1], square_data["location"][2])
create_sphere(sphere_radius, left_location, f"Left_{i}")
# 右側に球体を作成
right_location = (square_data["location"][0] + 1, square_data["location"][1], square_data["location"][2])
create_sphere(sphere_radius, right_location, f"Right_{i}")