Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2009 Blender Foundation. 00019 * All rights reserved. 00020 * 00021 * 00022 * Contributor(s): Joshua Leung 00023 * 00024 * ***** END GPL LICENSE BLOCK ***** 00025 */ 00026 00032 #include <stdlib.h> 00033 #include <stdio.h> 00034 00035 #include "RNA_define.h" 00036 #include "RNA_enum_types.h" 00037 00038 #include "DNA_anim_types.h" 00039 #include "DNA_object_types.h" 00040 #include "DNA_scene_types.h" 00041 00042 00043 #ifdef RNA_RUNTIME 00044 00045 #include "BKE_context.h" 00046 #include "BKE_report.h" 00047 00048 #include "ED_keyframing.h" 00049 00050 static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList *reports) 00051 { 00052 // TODO: enable access to providing a list of overrides (dsources)? 00053 int success = ANIM_validate_keyingset(C, NULL, ks); 00054 00055 if (success != 0) { 00056 switch (success) { 00057 case MODIFYKEY_INVALID_CONTEXT: 00058 BKE_report(reports, RPT_ERROR, "Invalid context for Keying Set"); 00059 break; 00060 00061 case MODIFYKEY_MISSING_TYPEINFO: 00062 BKE_report(reports, RPT_ERROR, "Incomplete built-in Keying Set. Appears to be missing type info"); 00063 break; 00064 } 00065 } 00066 } 00067 00068 #else 00069 00070 void RNA_api_keyingset(StructRNA *srna) 00071 { 00072 FunctionRNA *func; 00073 //PropertyRNA *parm; 00074 00075 /* validate relative Keying Set (used to ensure paths are ok for context) */ 00076 func= RNA_def_function(srna, "refresh", "rna_KeyingSet_context_refresh"); 00077 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"); 00078 RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); 00079 } 00080 00081 #endif 00082