1
$\begingroup$

I recieve a little program in which i have some cubes which are constructing like a crystal. I try to render it , but i have two problems: 1. i did not know how to move my camera around to the crystal 2. i did not know how to move away my camera in order to see my crystal perfectly , when he becomes bigger (100-200 cubes ). Thanks for your help ! P.S. - in the last for i amplified my iteration i with 2 because i didn't know how to set a radius of 0.5 at my object This is the program , so enjoy in helping me :) :

import bpy
from itertools import product

mesh = bpy.data.meshes['Cube']
objects_scene = bpy.context.scene.objects
objects_data  = bpy.data.objects
actions_data  = bpy.data.actions

def create_cube(name, location ):
    obj = objects_data.new(name, mesh)
    objects_scene.link(obj)
    obj.location = location
    return obj

def create_animation(obj, time):
    obj.animation_data_create()
    obj.animation_data.action = action = actions_data.new("Action")
    fcurves = [action.fcurves.new(data_path) for data_path in ("hide", "hide_render")]
    for fcu in fcurves:
        fcu.keyframe_points.insert(   0, 1, {'FAST'}).interpolation = "CONSTANT"
        fcu.keyframe_points.insert(time, 0, {'FAST'}).interpolation = "CONSTANT"
        fcu.extrapolation = "CONSTANT"

n = 7
time = 1    
for i in range(n):
    for indices in product(range(-i*2, i*2+2 , 2), repeat=3):
        if sum(abs(j) for j in indices) == i:
            cube = create_cube("Cube", indices)
            create_animation(cube, time)
            time += 1

this is a picture with what i want to create , but in this the camera is no moving . I want that my camera to move around the construction :)

that is for 4 or 5 iteration .

$\endgroup$
1
1
$\begingroup$

I don't know much about Python if that's what you're asking, but if you aren't and want to zoom the camera out through your animation, try moving the timeline cursor to the first frame, keying "I" and choosing LocRotScale. Then move to the end of your animation and repeat.

If you want to rotate the camera around the object, follow these instructions: How can I animate the camera in a perfect circular rotation around a fixed position?

I'm not sure if they work together, but they might. If they don't, look into camera focal length.

Hope this helps and happy Blending!

$\endgroup$
1
  • $\begingroup$ I want to manage this from python , but thanks you for your help:) $\endgroup$ – user21553 Feb 7 '16 at 10:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.