import bpy
import math
from math import radians
radius = 15
depth = 0
vertices = 60
zion_number = 15
zion_x = 30.0
zion_y = 0.0
zion_z = 0.0
disk_locations = [(zion_x, zion_y, zion_z)]
object_names = ['えんばん']
rotation_enabled = {'z': True, 'y': True}
object_names = 'cylinder'
z_rotation_enabled = {'cylinder': True}
y_rotation_enabled = {'cylinder': False}
for i, location in enumerate(disk_locations):
x, y, z = location
bpy.ops.mesh.primitive_cylinder_add(radius=radius, depth=depth, vertices=vertices, enter_editmode=False, align='WORLD', location=(x, y, z))
cylinder = bpy.context.object
cylinder.name = object_names
cylinder.rotation_euler = (radians(90), radians(0), radians(0))
if z_rotation_enabled[object_names]:
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.transform.rotate(value=radians(90), orient_axis='Z', orient_type='GLOBAL')
bpy.ops.object.mode_set(mode='OBJECT')
cylinder.rotation_euler.y = radians(90) if y_rotation_enabled[object_names] else radians(0)
bbb