fork(2) download
  1. # your code goes hereimport bpy
  2. from bpy import context
  3. from math import sin, cos, radians
  4.  
  5. cubeobject = bpy.ops.mesh.primitive_cube_add
  6.  
  7. cursor = context.scene.cursor_location
  8.  
  9. radialdist = 5.0
  10.  
  11. xsize = 1.0
  12. ysize = 1.0
  13. zsize = 1.0
  14. theta = 0.0
  15. twopi_over_8 = 6.28 / 8.0
  16.  
  17. while theta < 6.28:
  18. x = cursor.x + radialdist * cos(theta)
  19. y = cursor.y + radialdist * sin(theta)
  20. z = cursor.z
  21. cubeobject(location = (x,y,z))
  22.  
  23. theta+= twopi_over_8
  24.  
  25. theta = 0.0
  26. radialdist = 1.0
  27.  
Runtime error #stdin #stdout #stderr 0.02s 27712KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 2, in <module>
ImportError: No module named 'bpy'