Advertisement
VladSmirN

скриншоты в блендере

Jan 22nd, 2023
1,365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. import bpy
  2. import math  
  3. from mathutils import *
  4. import os
  5. #set your own target here
  6. target = bpy.data.objects['Syma_X8C.001']
  7. cam = bpy.data.objects['Camera']
  8.  
  9.  
  10. count = 0
  11. radius = 25
  12. for alpha in  range(90,160,20):
  13.   alpha = math.radians(alpha)
  14.   for betta in  range(0,360,25):
  15.     count += 1  
  16.     if count>36:
  17.         break
  18.     betta = math.radians(betta)
  19.    
  20.     cam.location.x = math.sin(alpha)*math.cos(betta)*radius
  21.     cam.location.y = math.sin(alpha)*math.sin(betta)*radius
  22.     cam.location.z = math.cos(alpha)*radius
  23.    
  24.     cam.rotation_euler[2] = betta + math.pi/2
  25.     cam.rotation_euler[0] = alpha  
  26.     cam.rotation_euler[1] = 0
  27.    
  28.     file = os.path.join('C:\project\Computer_Vision\\term_paper_2023\drone-blend', str(count))
  29.     print(file)
  30.     bpy.context.scene.render.filepath = file
  31.     bpy.ops.render.render( write_still=True )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement