Blender  V2.93
BKE_key.h
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) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 #pragma once
20 
24 struct Curve;
25 struct ID;
26 struct Key;
27 struct KeyBlock;
28 struct Lattice;
29 struct ListBase;
30 struct Main;
31 struct Mesh;
32 struct Object;
33 
34 /* Kernel prototypes */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 void BKE_key_free(struct Key *key);
40 void BKE_key_free_nolib(struct Key *key);
41 struct Key *BKE_key_add(struct Main *bmain, struct ID *id);
42 void BKE_key_sort(struct Key *key);
43 
44 void key_curve_position_weights(float t, float data[4], int type);
45 void key_curve_tangent_weights(float t, float data[4], int type);
46 void key_curve_normal_weights(float t, float data[4], int type);
47 
48 float *BKE_key_evaluate_object_ex(struct Object *ob, int *r_totelem, float *arr, size_t arr_size);
49 float *BKE_key_evaluate_object(struct Object *ob, int *r_totelem);
50 
51 int BKE_keyblock_element_count_from_shape(const struct Key *key, const int shape_index);
52 int BKE_keyblock_element_count(const struct Key *key);
53 
54 size_t BKE_keyblock_element_calc_size_from_shape(const struct Key *key, const int shape_index);
55 size_t BKE_keyblock_element_calc_size(const struct Key *key);
56 
57 bool BKE_key_idtype_support(const short id_type);
58 
59 struct Key **BKE_key_from_id_p(struct ID *id);
60 struct Key *BKE_key_from_id(struct ID *id);
61 struct Key **BKE_key_from_object_p(const struct Object *ob);
62 struct Key *BKE_key_from_object(const struct Object *ob);
63 struct KeyBlock *BKE_keyblock_from_object(struct Object *ob);
65 
66 struct KeyBlock *BKE_keyblock_add(struct Key *key, const char *name);
67 struct KeyBlock *BKE_keyblock_add_ctime(struct Key *key, const char *name, const bool do_force);
68 struct KeyBlock *BKE_keyblock_from_key(struct Key *key, int index);
69 struct KeyBlock *BKE_keyblock_find_name(struct Key *key, const char name[]);
70 void BKE_keyblock_copy_settings(struct KeyBlock *kb_dst, const struct KeyBlock *kb_src);
71 char *BKE_keyblock_curval_rnapath_get(struct Key *key, struct KeyBlock *kb);
72 
73 /* conversion functions */
74 /* Note: 'update_from' versions do not (re)allocate mem in kb, while 'convert_from' do. */
75 void BKE_keyblock_update_from_lattice(struct Lattice *lt, struct KeyBlock *kb);
76 void BKE_keyblock_convert_from_lattice(struct Lattice *lt, struct KeyBlock *kb);
77 void BKE_keyblock_convert_to_lattice(struct KeyBlock *kb, struct Lattice *lt);
78 
81  const float mat[4][4],
82  const void *src,
83  void *dst);
84 void BKE_keyblock_update_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb);
85 void BKE_keyblock_convert_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb);
86 void BKE_keyblock_convert_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb);
87 
88 void BKE_keyblock_update_from_mesh(struct Mesh *me, struct KeyBlock *kb);
89 void BKE_keyblock_convert_from_mesh(struct Mesh *me, struct Key *key, struct KeyBlock *kb);
90 void BKE_keyblock_convert_to_mesh(struct KeyBlock *kb, struct Mesh *me);
92  struct Mesh *mesh,
93  float (*r_vertnors)[3],
94  float (*r_polynors)[3],
95  float (*r_loopnors)[3]);
96 
98  struct KeyBlock *kb,
99  const float (*vertCos)[3]);
101  struct KeyBlock *kb,
102  const float (*vertCos)[3]);
103 float (*BKE_keyblock_convert_to_vertcos(struct Object *ob, struct KeyBlock *kb))[3];
104 
106  struct KeyBlock *kb,
107  const float (*ofs)[3]);
108 
109 /* other management */
110 bool BKE_keyblock_move(struct Object *ob, int org_index, int new_index);
111 
112 bool BKE_keyblock_is_basis(struct Key *key, const int index);
113 
114 /* -------------------------------------------------------------------- */
118 void BKE_keyblock_data_get_from_shape(const struct Key *key,
119  float (*arr)[3],
120  const int shape_index);
121 void BKE_keyblock_data_get(const struct Key *key, float (*arr)[3]);
122 
123 void BKE_keyblock_data_set_with_mat4(struct Key *key,
124  const int shape_index,
125  const float (*coords)[3],
126  const float mat[4][4]);
128  const struct ListBase *nurb,
129  const int shape_index,
130  const void *data,
131  const float mat[4][4]);
132 void BKE_keyblock_data_set(struct Key *key, const int shape_index, const void *data);
133 
136 #ifdef __cplusplus
137 };
138 #endif
typedef float(TangentPoint)[2]
struct KeyBlock * BKE_keyblock_from_key(struct Key *key, int index)
Definition: key.c:1926
float * BKE_key_evaluate_object_ex(struct Object *ob, int *r_totelem, float *arr, size_t arr_size)
Definition: key.c:1520
void BKE_keyblock_data_get_from_shape(const struct Key *key, float(*arr)[3], const int shape_index)
void key_curve_normal_weights(float t, float data[4], int type)
Definition: key.c:429
bool BKE_keyblock_move(struct Object *ob, int org_index, int new_index)
Definition: key.c:2519
struct Key * BKE_key_from_id(struct ID *id)
Definition: key.c:1786
void BKE_keyblock_convert_from_vertcos(struct Object *ob, struct KeyBlock *kb, const float(*vertCos)[3])
Definition: key.c:2380
void BKE_keyblock_curve_data_set_with_mat4(struct Key *key, const struct ListBase *nurb, const int shape_index, const void *data, const float mat[4][4])
void BKE_keyblock_data_set_with_mat4(struct Key *key, const int shape_index, const float(*coords)[3], const float mat[4][4])
Definition: key.c:1685
struct KeyBlock * BKE_keyblock_find_name(struct Key *key, const char name[])
Definition: key.c:1944
void BKE_key_free_nolib(struct Key *key)
Definition: key.c:247
float(* BKE_keyblock_convert_to_vertcos(struct Object *ob, struct KeyBlock *kb))[3]
Definition: key.c:2413
struct Key ** BKE_key_from_id_p(struct ID *id)
Definition: key.c:1761
struct KeyBlock * BKE_keyblock_from_object_reference(struct Object *ob)
Definition: key.c:1914
size_t BKE_keyblock_element_calc_size(const struct Key *key)
void BKE_keyblock_mesh_calc_normals(struct KeyBlock *kb, struct Mesh *mesh, float(*r_vertnors)[3], float(*r_polynors)[3], float(*r_loopnors)[3])
Definition: key.c:2249
void BKE_keyblock_convert_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb)
struct Key * BKE_key_from_object(const struct Object *ob)
void BKE_keyblock_copy_settings(struct KeyBlock *kb_dst, const struct KeyBlock *kb_src)
void BKE_keyblock_convert_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb)
Definition: key.c:2133
bool BKE_key_idtype_support(const short id_type)
Definition: key.c:1749
void BKE_keyblock_convert_from_lattice(struct Lattice *lt, struct KeyBlock *kb)
Definition: key.c:2008
void BKE_keyblock_convert_to_lattice(struct KeyBlock *kb, struct Lattice *lt)
Definition: key.c:2025
float * BKE_key_evaluate_object(struct Object *ob, int *r_totelem)
Definition: key.c:1616
void BKE_keyblock_update_from_offset(struct Object *ob, struct KeyBlock *kb, const float(*ofs)[3])
Definition: key.c:2473
bool BKE_keyblock_is_basis(struct Key *key, const int index)
Definition: key.c:2600
void BKE_keyblock_data_set(struct Key *key, const int shape_index, const void *data)
Definition: key.c:1734
void BKE_keyblock_update_from_mesh(struct Mesh *me, struct KeyBlock *kb)
Definition: key.c:2188
void BKE_key_sort(struct Key *key)
Definition: key.c:316
int BKE_keyblock_curve_element_count(struct ListBase *nurb)
Definition: key.c:2044
void BKE_keyblock_convert_from_mesh(struct Mesh *me, struct Key *key, struct KeyBlock *kb)
Definition: key.c:2208
void BKE_key_free(struct Key *key)
Definition: key.c:242
char * BKE_keyblock_curval_rnapath_get(struct Key *key, struct KeyBlock *kb)
Definition: key.c:1966
struct Key ** BKE_key_from_object_p(const struct Object *ob)
void BKE_keyblock_convert_to_mesh(struct KeyBlock *kb, struct Mesh *me)
Definition: key.c:2224
struct KeyBlock * BKE_keyblock_add_ctime(struct Key *key, const char *name, const bool do_force)
Definition: key.c:1873
void key_curve_tangent_weights(float t, float data[4], int type)
Definition: key.c:390
void BKE_keyblock_update_from_lattice(struct Lattice *lt, struct KeyBlock *kb)
Definition: key.c:1988
struct KeyBlock * BKE_keyblock_from_object(struct Object *ob)
Definition: key.c:1902
void BKE_keyblock_data_get(const struct Key *key, float(*arr)[3])
void BKE_keyblock_update_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb)
struct KeyBlock * BKE_keyblock_add(struct Key *key, const char *name)
Definition: key.c:1817
struct Key * BKE_key_add(struct Main *bmain, struct ID *id)
Definition: key.c:259
void BKE_keyblock_update_from_vertcos(struct Object *ob, struct KeyBlock *kb, const float(*vertCos)[3])
Definition: key.c:2320
int BKE_keyblock_element_count(const struct Key *key)
void key_curve_position_weights(float t, float data[4], int type)
Definition: key.c:348
size_t BKE_keyblock_element_calc_size_from_shape(const struct Key *key, const int shape_index)
void BKE_keyblock_curve_data_transform(const struct ListBase *nurb, const float mat[4][4], const void *src, void *dst)
int BKE_keyblock_element_count_from_shape(const struct Key *key, const int shape_index)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Definition: DNA_ID.h:273
char name[64]
Definition: DNA_key_types.h:68
Definition: BKE_main.h:116