AddOn: Target Camera

Hi everyone :slight_smile:

This is my first post and first script :slight_smile:
I’ve created simple script that adds camera with target, adds target to camera and ranames target to camera’s name. First two have options to change shape and size of target, the second one also have option where to place target (in front of camera or at 3D cursor).
Hope it will be usefull :smiley:

If you have any requests don’t be shy and write :slight_smile:

Download:
http://adf.ly/FUEHR or you can click here http://www.mediafire.com/?a1qtlgh1t9naf0i if you don’t like adf.ly :slight_smile:

http://i.imgur.com/hBBFz.png

http://i.imgur.com/4ix2n.png

http://i.imgur.com/w0mgl.png

http://i.imgur.com/TM2kI.png

Also I’d like to know if this is good way to add operators to specials menu for specific type of object (in this case for camera)? It works but I supose there can be nicer way to do it.

def Add_target_to_camera_menu_draw(self, context):
    if context.object.type == 'CAMERA' :
        self.layout.operator_context = 'INVOKE_REGION_WIN'
        self.layout.operator(Add_target_to_camera.bl_idname, "Add target to camera")

Use the poll() function maybe?

Unfortunetely poll() makes those operators visible in specials for every object and active only for camera. Maybe I’m doing something wrong.

how rotate camera?

You have to click on Camera, click on Object Contraints and in TargetTo tick “Target Z”. Then click on target empty and rotate it - camera should rotate too. Unfortunetelly it doesnt work very good. I tried couple times to do it better but I failed.

I’ve made rig of camera to make possible rotation of camera indepedent of target rotation (used for defining axis of rotation). It’s a bit buggy (camera flips upsidedown if you rotate target too much). Please, test it and if you like it I’ll try to implemet it :slight_smile:

bugs with animations to add keys both to camera and target positions and rotations

Would you like to be more precise what happens? Those bugs are in script or test rig?