Blender  V2.93
rna_meta_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 
27 #include "RNA_define.h"
28 
29 #include "BLI_sys_types.h"
30 
31 #include "BLI_utildefines.h"
32 
33 #include "BKE_mball.h"
34 
35 #include "rna_internal.h" /* own include */
36 
37 #ifdef RNA_RUNTIME
38 static void rna_Meta_transform(struct MetaBall *mb, float *mat)
39 {
40  BKE_mball_transform(mb, (float(*)[4])mat, true);
41 
42  DEG_id_tag_update(&mb->id, 0);
43 }
44 
45 static void rna_Mball_update_gpu_tag(MetaBall *mb)
46 {
48 }
49 #else
50 
52 {
53  FunctionRNA *func;
54  PropertyRNA *parm;
55 
56  func = RNA_def_function(srna, "transform", "rna_Meta_transform");
57  RNA_def_function_ui_description(func, "Transform metaball elements by a matrix");
58  parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
60 
61  RNA_def_function(srna, "update_gpu_tag", "rna_Mball_update_gpu_tag");
62 }
63 
64 #endif
void BKE_mball_batch_cache_dirty_tag(struct MetaBall *mb, int mode)
Definition: mball.c:748
@ BKE_MBALL_BATCH_DIRTY_ALL
Definition: BKE_mball.h:82
void BKE_mball_transform(struct MetaBall *mb, const float mat[4][4], const bool do_props)
Definition: mball.c:617
void DEG_id_tag_update(struct ID *id, int flag)
@ PARM_REQUIRED
Definition: RNA_types.h:337
PropertyRNA * RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3943
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_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1547
void RNA_api_meta(StructRNA *srna)
Definition: rna_meta_api.c:51