You can render around an object 360 degrees with python script.
Open your scene and add some lights, and a Susanne object on the origin point – this will be rendered by the camera.
You need to have these names for the objects because are used by the script: Camera and Suzanne.
If you want to add more objects or lights then these can be set on the origin point.
The script has all set for these objects and when is running then Blender 3D software is not available.
This is the source code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | import bpy import math # Set the object that the camera will orbit around #target_object = bpy.data.objects["MyObject"] # Create a new empty object empty = bpy.data.objects.new("Empty", None) # Set the empty object's location to the origin point empty.location = (0, 0, 0) # Set the starting position for the camera camera = bpy.data.objects["Camera"] # Set the number of degrees to rotate the camera around the object degrees = 360 # Set the distance that the camera should be from the object distance = 7.6 # Set the speed at which the camera should orbit speed = 10 # Set the direction in which the camera should orbit (1 for clockwise, -1 for counter-clockwise) direction = 1 # Set the camera to track the object bpy.ops.object.select_all(action="DESELECT") camera.select_set(True) # Set the distance to origin point camera.location = (-distance, 0, 0) bpy.context.view_layer.objects.active = camera # Remove all constraints from the object "Suzanne" bpy.data.objects['Suzanne'].select_get() bpy.context.view_layer.objects.active = bpy.data.objects['Suzanne'] bpy.ops.object.constraints_clear() # Add a track to constraint to the object and set it bpy.ops.object.constraint_add(type="TRACK_TO") bpy.ops.object.track_set(type="TRACKTO") # Set the target object as the tracking target bpy.data.objects['Suzanne'].select_get() bpy.context.view_layer.objects.active = bpy.data.objects['Suzanne'] # Select the file image format bpy.context.scene.render.image_settings.file_format = 'PNG' # Animate the camera orbiting around the object for frame in range(0, 36): # Set the current frame bpy.context.scene.frame_set(frame) # Calculate the new position for the camera based on its distance from the object x = distance * math.sin(math.radians(frame*speed*direction)) y = distance * math.cos(math.radians(frame*speed*direction)) camera.location = (x,y,0) # Set the output path for the rendered image bpy.context.scene.render.filepath = "C:\\tmp\\myimage_" + str(frame).zfill(3) + ".png" # Render the frame and save it to the output file bpy.ops.render.render(write_still=True) |
This is the result of the running script: