2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2009 Blender Foundation.
19 * All rights reserved.
22 * Contributor(s): Joshua Leung
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file blender/makesrna/intern/rna_animation_api.c
35 #include "RNA_define.h"
36 #include "RNA_enum_types.h"
38 #include "DNA_anim_types.h"
39 #include "DNA_object_types.h"
40 #include "DNA_scene_types.h"
45 #include "BKE_context.h"
46 #include "BKE_report.h"
48 #include "ED_keyframing.h"
50 static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList *reports)
52 // TODO: enable access to providing a list of overrides (dsources)?
53 int success = ANIM_validate_keyingset(C, NULL, ks);
57 case MODIFYKEY_INVALID_CONTEXT:
58 BKE_report(reports, RPT_ERROR, "Invalid context for Keying Set");
61 case MODIFYKEY_MISSING_TYPEINFO:
62 BKE_report(reports, RPT_ERROR, "Incomplete built-in Keying Set. Appears to be missing type info");
70 void RNA_api_keyingset(StructRNA *srna)
75 /* validate relative Keying Set (used to ensure paths are ok for context) */
76 func= RNA_def_function(srna, "refresh", "rna_KeyingSet_context_refresh");
77 RNA_def_function_ui_description(func, "Refresh Keying Set to ensure that it is valid for the current context. Call before each use of one");
78 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);