Blender  V2.93
rna_action_api.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <time.h>
28 
29 #include "BLI_utildefines.h"
30 
31 #include "RNA_define.h"
32 
33 #include "DNA_action_types.h"
34 
35 #include "rna_internal.h" /* own include */
36 
37 #ifdef RNA_RUNTIME
38 
39 # include "BKE_action.h"
40 
41 # include "DNA_anim_types.h"
42 # include "DNA_curve_types.h"
43 
44 static void rna_Action_flip_with_pose(bAction *act, ReportList *reports, Object *ob)
45 {
46  if (ob->type != OB_ARMATURE) {
47  BKE_report(reports, RPT_ERROR, "Only armature objects are supported");
48  return;
49  }
51 
52  /* Only for redraw. */
54 }
55 
56 #else
57 
59 {
60  FunctionRNA *func;
61  PropertyRNA *parm;
62 
63  func = RNA_def_function(srna, "flip_with_pose", "rna_Action_flip_with_pose");
64  RNA_def_function_ui_description(func, "Flip the action around the X axis using a pose");
66 
67  parm = RNA_def_pointer(
68  func, "object", "Object", "", "The reference armature object to use when flipping");
70 }
71 
72 #endif
Blender kernel action and pose functionality.
void BKE_action_flip_with_pose(struct bAction *act, struct Object *ob_arm)
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
@ OB_ARMATURE
@ PARM_REQUIRED
Definition: RNA_types.h:337
@ FUNC_USE_REPORTS
Definition: RNA_types.h:578
@ PROP_NEVER_NULL
Definition: RNA_types.h:225
#define NC_ANIMATION
Definition: WM_types.h:289
#define NA_EDITED
Definition: WM_types.h:462
#define ND_KEYFRAME
Definition: WM_types.h:394
void RNA_api_action(StructRNA *srna)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4159
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4262
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4337
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4332
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1547
void WM_main_add_notifier(unsigned int type, void *reference)