Blender  V2.93
rna_lattice_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 "rna_internal.h" /* own include */
34 
35 #ifdef RNA_RUNTIME
36 static void rna_Lattice_transform(Lattice *lt, float *mat, bool shape_keys)
37 {
38  BKE_lattice_transform(lt, (float(*)[4])mat, shape_keys);
39 
40  DEG_id_tag_update(&lt->id, 0);
41 }
42 
43 static void rna_Lattice_update_gpu_tag(Lattice *lt)
44 {
46 }
47 
48 #else
49 
51 {
52  FunctionRNA *func;
53  PropertyRNA *parm;
54 
55  func = RNA_def_function(srna, "transform", "rna_Lattice_transform");
56  RNA_def_function_ui_description(func, "Transform lattice by a matrix");
57  parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
59  RNA_def_boolean(func, "shape_keys", 0, "", "Transform Shape Keys");
60 
61  RNA_def_function(srna, "update_gpu_tag", "rna_Lattice_update_gpu_tag");
62 }
63 
64 #endif
@ BKE_LATTICE_BATCH_DIRTY_ALL
Definition: BKE_lattice.h:90
void BKE_lattice_transform(struct Lattice *lt, const float mat[4][4], bool do_keys)
Definition: lattice.c:715
void BKE_lattice_batch_cache_dirty_tag(struct Lattice *lt, int mode)
Definition: lattice.c:793
void DEG_id_tag_update(struct ID *id, int flag)
@ PARM_REQUIRED
Definition: RNA_types.h:337
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
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_lattice(StructRNA *srna)