Hi all,
I am currently working on creating an animation showing segmentation results of my lab. These results are saved as .stl surfaces. My aim is to create a script that will import the 1000 surfaces as well as creating a camera and a bezier circle or curve on which the camera moves along.
I am currently stuck with the camera creation
For my purpose I need to increase the value of clip_end to a very high number. As far as I know I also have to be able to select the camera using something like camera.select=True in order to let it follow the path of a bezier circle (bpy.ops.object.parent_set(type=‘FOLLOW’, xmirror=False, keep_transform=False)). I also need to define a camera location and a constraint whih lets it ‘look’ at an empty. Using the GUI I have no problem of setting all these parameters but neither the Info window nor the API provide enough information for me to do this. I tried
camera=bpy.data.cameras.new(‘Camera’) as well as
camera2=bpy.data.objects.new(‘Camera’, camera)
to do this but both do not suit my needs. Is there anything i misunderstood?
Thank you for your help!
Hey,
sorry for the double post that is my mistake. Maybe some admin could delete the other topic?
I think i might have been a bit consufing in my message above. What I need is the code to:
-create a camera (which should be visible in the 3D View Window)
-set the clip_end value to 9999999999999
-attach it to a bezier circle (parent -> follow path) for getting a camera path
-add a constraint so that it will always look at an empty
I hope you can help me with that because if I create cameras using bpy.data.cameras.new(), bpy.data.cameras.new() or bpy.ops.object.camera_add() I cannot apply all these changes
Thank you very much!
Hey,
I have one mor equestion. I would also like to alter the amount of frames needed for the camera to move around the circle.
bpy.ops.curve.primitive_bezier_circle_add()
circle = bpy.context.object
circleContext=bpy.context.scene.objects.active
Unfortunately the value of path_duration can only be accessed via the bpy.data.curves[‘someName’].path_duration which is not practicable for my purpose. Is there any ‘link’ between the object BezierCircle to the corresponding curve?
Thank you for your help!