import bpy
from math import radians
# Create a cylinder
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=2)
# Select rotation axis
zion_xyz = 'zana'
if zion_xyz == 'xana':
# Rotate 90 degrees around X-axis
bpy.context.object.rotation_euler[0] = radians(90)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(0)
# Scale along X-axis
bpy.context.object.scale[0] = 3
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 1
elif zion_xyz == 'yana':
# Rotate 90 degrees around Y-axis
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(90)
bpy.context.object.rotation_euler[2] = radians(0)
# Scale along Y-axis
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 3
bpy.context.object.scale[2] = 1
elif zion_xyz == 'zana':
# Rotate 90 degrees around Z-axis
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(90)
# Scale along Z-axis
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 10
else:
print('Invalid rotation axis selected.')
# Select the cylinder
bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]
import bpy
from math import radians
# Create a cylinder
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=2)
# Select rotation axis
zion_xyz = 'zana'
if zion_xyz == 'xana':
# Rotate 90 degrees around X-axis
bpy.context.object.rotation_euler[0] = radians(90)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(0)
# Scale along X-axis
bpy.context.object.scale[0] = 3
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 1
elif zion_xyz == 'yana':
# Rotate 90 degrees around Y-axis
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(90)
bpy.context.object.rotation_euler[2] = radians(0)
# Scale along Y-axis
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 3
bpy.context.object.scale[2] = 1
elif zion_xyz == 'zana':
# Rotate 90 degrees around Z-axis
bpy.context.object.rotation_euler[0] = radians(0)
bpy.context.object.rotation_euler[1] = radians(0)
bpy.context.object.rotation_euler[2] = radians(90)
# Scale along Z-axis
bpy.context.object.scale[0] = 1
bpy.context.object.scale[1] = 1
bpy.context.object.scale[2] = 10
else:
print('Invalid rotation axis selected.')
# Select the cylinder
bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]
bbb