Insert Keyframe, just a handout

Handout:

class ANIM_OT_insert_keyframe(Operator):    
    "Inserts keyframes based on specified keying set."
    bl_idname = 'anim.insert_keyframe'
    bl_label = 'Insert Keyframe'
    bl_options = {'UNDO'}
    # Keeping it short and sweat, don't want to redo whats already been done.
    prop = EnumProperty(name='Keyframe Type',
                    description="Type of Keying Set to insert for selected object.",
                    items=[('Location', 
                            'Location', 
                            "Insert a keyframe on each of the location channels."),
                           
                           ('Rotation', 
                            'Rotation', 
                            "Insert a keyframe on each of the rotation channels."),
                           
                           ('Scaling', 
                            'Scale', 
                            "Insert a keyframe on each of the scale channels."),
                           
                           ('BUILTIN_KSI_LocRot', 
                            'LocRot', 
                            "Insert a keyframe on each of the location and rotation channels."),
                           
                           ('BUILTIN_KSI_LocScale', 
                            'LocScale', 
                            "Insert a keyframe on each of the location and scale channels."),
                           
                           ('LocRotScale', 
                            'LocRotScale', 
                            "Insert a keyframe on each of the location, rotation, and scale channels."),
                           
                           ('BUILTIN_KSI_RotScale', 
                            'RotScale', 
                            "Insert a keyframe on each of the rotation and scale channels."),
                           
                           ('BUILTIN_KSI_VisualLoc', 
                            'Visual Location', 
                            "Insert a keyframe on each of the location channels, taking into account effects of constraints and relationships."),
                           
                           ('BUILTIN_KSI_VisualRot', 
                            'Visual Rotation', 
                            "Insert a keyframe on each of the rotation channels, taking into account effects of constraints and relationships."),
                           
                           ('BUILTIN_KSI_VisualScaling', 
                            'Visual Scaling', 
                            "Insert a keyframe on each of the scale channels, taking into account effects of constraints and relationships."),
                           
                           ('BUILTIN_KSI_VisualLocRot', 
                            'Visual LocRot', 
                            "Insert a keyframe on each of the location and rotation channels, taking into account effects of constraints and relationships."),
                           
                           ('BUILTIN_KSI_VisualLocScale', 
                            'Visual LocScale', 
                            "Insert a keyframe on each of the location and scaling channels, taking into account effects of constraints and relationships."),
                           
                           ('BUILTIN_KSI_VisualLocRotScale', 
                            'Visual LocRotScale', 
                            "Insert a keyframe on each of the location, rotation and scaling channels, taking into account effects of constraints and relationships."),
                           
                           ('BUILTIN_KSI_VisualRotScale', 
                            'Visual RotScale', 
                            "Insert a keyframe on each of the rotation and scaling channels, taking into account effects of constraints and relationships."),
                           
                           ('Available', 
                            'Available', 
                            "Insert a keyframe on each of the already existing F-Curve channels."),
                           
                           ('BUILTIN_KSI_DeltaLocation', 
                            'Delta Location', 
                            "Insert keyframes for additional location offset."),
                           
                           ('BUILTIN_KSI_DeltaRotation', 
                            'Delta Rotation', 
                            "Insert keyframes for additional rotation offset."),
                           
                           ('BUILTIN_KSI_DeltaScale', 
                            'Delta Scale', 
                            "Insert keyframes for additional scaling factor.")],
                           default='Location')
    
    @classmethod
    def poll(cls, context):
        return context.space_data.type in 'VIEW_3D'
        return context.object
    
    def execute(self, context):
        key_set = self.prop
        bpy.ops.anim.keyframe_insert_menu(type=key_set)
        self.report ({'INFO'}, "Keyframed '%s'" % key_set)
        return {'FINISHED'}

maybe someone find a use for it, i hate wasting :slight_smile: