4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2009 Blender Foundation.
21 * All rights reserved.
24 * Contributor(s): Joshua Leung
26 * ***** END GPL LICENSE BLOCK *****
32 #include "RNA_define.h"
33 #include "RNA_enum_types.h"
34 #include "RNA_types.h"
36 #include "DNA_anim_types.h"
37 #include "DNA_object_types.h"
38 #include "DNA_scene_types.h"
42 #include "BKE_animsys.h"
44 // Scene API stuff from kazanbas branch here...
47 static KeyingSet *rna_Scene_add_keying_set(Scene *sce, ReportList *reports,
48 char name[], int absolute, int insertkey_needed, int insertkey_visual)
51 short flag=0, keyingflag=0;
55 flag |= KEYINGSET_ABSOLUTE;
57 keyingflag |= INSERTKEY_NEEDED;
59 keyingflag |= INSERTKEY_MATRIX;
61 /* call the API func, and set the active keyingset index */
62 ks= BKE_keyingset_add(&sce->keyingsets, name, flag, keyingflag);
65 sce->active_keyingset= BLI_countlist(&sce->keyingsets);
69 BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
76 void RNA_api_scene(StructRNA *srna)
81 // Scene API stuff from kazanbas branch here...
84 func= RNA_def_function(srna, "add_keying_set", "rna_Scene_add_keying_set");
85 RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
86 RNA_def_function_flag(func, FUNC_USE_REPORTS);
87 /* returns the new KeyingSet */
88 parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
89 RNA_def_function_return(func, parm);
91 RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
93 RNA_def_boolean(func, "absolute", 1, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
95 RNA_def_boolean(func, "insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves.");
96 RNA_def_boolean(func, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");