Blender  V3.3
BKE_key.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 #pragma once
4 
8 struct Curve;
9 struct ID;
10 struct Key;
11 struct KeyBlock;
12 struct Lattice;
13 struct ListBase;
14 struct Main;
15 struct Mesh;
16 struct MVert;
17 struct Object;
18 
19 /* Kernel prototypes */
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
27 void BKE_key_free_data(struct Key *key);
28 void BKE_key_free_nolib(struct Key *key);
29 struct Key *BKE_key_add(struct Main *bmain, struct ID *id);
35 void BKE_key_sort(struct Key *key);
36 
37 void key_curve_position_weights(float t, float data[4], int type);
41 void key_curve_tangent_weights(float t, float data[4], int type);
45 void key_curve_normal_weights(float t, float data[4], int type);
46 
53  struct Object *ob, int *r_totelem, float *arr, size_t arr_size, struct ID *obdata);
54 float *BKE_key_evaluate_object(struct Object *ob, int *r_totelem);
55 
59 int BKE_keyblock_element_count_from_shape(const struct Key *key, int shape_index);
60 int BKE_keyblock_element_count(const struct Key *key);
61 
65 size_t BKE_keyblock_element_calc_size_from_shape(const struct Key *key, int shape_index);
66 size_t BKE_keyblock_element_calc_size(const struct Key *key);
67 
68 bool BKE_key_idtype_support(short id_type);
69 
70 struct Key **BKE_key_from_id_p(struct ID *id);
71 struct Key *BKE_key_from_id(struct ID *id);
72 struct Key **BKE_key_from_object_p(struct Object *ob);
73 struct Key *BKE_key_from_object(struct Object *ob);
77 struct KeyBlock *BKE_keyblock_from_object(struct Object *ob);
79 
80 struct KeyBlock *BKE_keyblock_add(struct Key *key, const char *name);
89 struct KeyBlock *BKE_keyblock_add_ctime(struct Key *key, const char *name, bool do_force);
93 struct KeyBlock *BKE_keyblock_from_key(struct Key *key, int index);
97 struct KeyBlock *BKE_keyblock_find_name(struct Key *key, const char name[]);
101 void BKE_keyblock_copy_settings(struct KeyBlock *kb_dst, const struct KeyBlock *kb_src);
106 char *BKE_keyblock_curval_rnapath_get(const struct Key *key, const struct KeyBlock *kb);
107 
108 /* conversion functions */
109 /* NOTE: 'update_from' versions do not (re)allocate mem in kb, while 'convert_from' do. */
110 
111 void BKE_keyblock_update_from_lattice(const struct Lattice *lt, struct KeyBlock *kb);
112 void BKE_keyblock_convert_from_lattice(const struct Lattice *lt, struct KeyBlock *kb);
113 void BKE_keyblock_convert_to_lattice(const struct KeyBlock *kb, struct Lattice *lt);
114 
117  const float mat[4][4],
118  const void *src,
119  void *dst);
120 void BKE_keyblock_update_from_curve(const struct Curve *cu,
121  struct KeyBlock *kb,
122  const struct ListBase *nurb);
124  struct KeyBlock *kb,
125  const struct ListBase *nurb);
126 void BKE_keyblock_convert_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb);
127 
128 void BKE_keyblock_update_from_mesh(const struct Mesh *me, struct KeyBlock *kb);
129 void BKE_keyblock_convert_from_mesh(const struct Mesh *me,
130  const struct Key *key,
131  struct KeyBlock *kb);
132 void BKE_keyblock_convert_to_mesh(const struct KeyBlock *kb, struct MVert *mvert, int totvert);
133 
144  const struct Mesh *mesh,
145  float (*r_vertnors)[3],
146  float (*r_polynors)[3],
147  float (*r_loopnors)[3]);
148 
150  struct KeyBlock *kb,
151  const float (*vertCos)[3]);
153  struct KeyBlock *kb,
154  const float (*vertCos)[3]);
155 float (*BKE_keyblock_convert_to_vertcos(const struct Object *ob, const struct KeyBlock *kb))[3];
156 
158  struct KeyBlock *kb,
159  const float (*ofs)[3]);
160 
161 /* other management */
162 
172 bool BKE_keyblock_move(struct Object *ob, int org_index, int new_index);
173 
177 bool BKE_keyblock_is_basis(const struct Key *key, int index);
178 
179 /* -------------------------------------------------------------------- */
186 void BKE_keyblock_data_get_from_shape(const struct Key *key, float (*arr)[3], int shape_index);
187 void BKE_keyblock_data_get(const struct Key *key, float (*arr)[3]);
188 
192 void BKE_keyblock_data_set_with_mat4(struct Key *key,
193  int shape_index,
194  const float (*coords)[3],
195  const float mat[4][4]);
201  const struct ListBase *nurb,
202  int shape_index,
203  const void *data,
204  const float mat[4][4]);
208 void BKE_keyblock_data_set(struct Key *key, int shape_index, const void *data);
209 
212 #ifdef __cplusplus
213 };
214 #endif
typedef float(TangentPoint)[2]
struct KeyBlock * BKE_keyblock_from_key(struct Key *key, int index)
Definition: key.c:1913
void key_curve_normal_weights(float t, float data[4], int type)
Definition: key.c:415
bool BKE_keyblock_move(struct Object *ob, int org_index, int new_index)
Definition: key.c:2492
struct Key * BKE_key_from_id(struct ID *id)
Definition: key.c:1783
void BKE_keyblock_update_from_offset(const struct Object *ob, struct KeyBlock *kb, const float(*ofs)[3])
void BKE_key_free_data(struct Key *key)
Definition: key.c:235
char * BKE_keyblock_curval_rnapath_get(const struct Key *key, const struct KeyBlock *kb)
void BKE_keyblock_update_from_vertcos(const struct Object *ob, struct KeyBlock *kb, const float(*vertCos)[3])
struct KeyBlock * BKE_keyblock_find_name(struct Key *key, const char name[])
Definition: key.c:1930
void BKE_key_free_nolib(struct Key *key)
Definition: key.c:240
struct Key ** BKE_key_from_id_p(struct ID *id)
Definition: key.c:1758
struct KeyBlock * BKE_keyblock_from_object_reference(struct Object *ob)
Definition: key.c:1902
bool BKE_keyblock_is_basis(const struct Key *key, int index)
size_t BKE_keyblock_element_calc_size(const struct Key *key)
void BKE_keyblock_data_set(struct Key *key, int shape_index, const void *data)
Definition: key.c:1731
void BKE_keyblock_convert_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb)
void BKE_keyblock_copy_settings(struct KeyBlock *kb_dst, const struct KeyBlock *kb_src)
copy shape-key attributes, but not key data or name/UID.
void BKE_keyblock_convert_from_curve(const struct Curve *cu, struct KeyBlock *kb, const struct ListBase *nurb)
float * BKE_key_evaluate_object(struct Object *ob, int *r_totelem)
Definition: key.c:1632
void BKE_keyblock_data_set_with_mat4(struct Key *key, int shape_index, const float(*coords)[3], const float mat[4][4])
Definition: key.c:1689
void BKE_keyblock_update_from_mesh(const struct Mesh *me, struct KeyBlock *kb)
void BKE_keyblock_update_from_curve(const struct Curve *cu, struct KeyBlock *kb, const struct ListBase *nurb)
void BKE_keyblock_update_from_lattice(const struct Lattice *lt, struct KeyBlock *kb)
float * BKE_key_evaluate_object_ex(struct Object *ob, int *r_totelem, float *arr, size_t arr_size, struct ID *obdata)
Definition: key.c:1511
void BKE_keyblock_convert_from_mesh(const struct Mesh *me, const struct Key *key, struct KeyBlock *kb)
void BKE_keyblock_convert_from_vertcos(const struct Object *ob, struct KeyBlock *kb, const float(*vertCos)[3])
void BKE_key_sort(struct Key *key)
Definition: key.c:304
void BKE_keyblock_data_get_from_shape(const struct Key *key, float(*arr)[3], int shape_index)
void BKE_keyblock_mesh_calc_normals(const struct KeyBlock *kb, const struct Mesh *mesh, float(*r_vertnors)[3], float(*r_polynors)[3], float(*r_loopnors)[3])
struct Key ** BKE_key_from_object_p(struct Object *ob)
Definition: key.c:1794
void BKE_keyblock_convert_to_lattice(const struct KeyBlock *kb, struct Lattice *lt)
void BKE_keyblock_curve_data_set_with_mat4(struct Key *key, const struct ListBase *nurb, int shape_index, const void *data, const float mat[4][4])
void BKE_keyblock_convert_to_mesh(const struct KeyBlock *kb, struct MVert *mvert, int totvert)
void key_curve_tangent_weights(float t, float data[4], int type)
Definition: key.c:377
struct Key * BKE_key_from_object(struct Object *ob)
Definition: key.c:1803
int BKE_keyblock_element_count_from_shape(const struct Key *key, int shape_index)
struct KeyBlock * BKE_keyblock_from_object(struct Object *ob)
Definition: key.c:1890
void BKE_keyblock_data_get(const struct Key *key, float(*arr)[3])
float(* BKE_keyblock_convert_to_vertcos(const struct Object *ob, const struct KeyBlock *kb))[3]
size_t BKE_keyblock_element_calc_size_from_shape(const struct Key *key, int shape_index)
struct KeyBlock * BKE_keyblock_add_ctime(struct Key *key, const char *name, bool do_force)
Definition: key.c:1862
struct KeyBlock * BKE_keyblock_add(struct Key *key, const char *name)
Definition: key.c:1814
struct Key * BKE_key_add(struct Main *bmain, struct ID *id)
Definition: key.c:252
int BKE_keyblock_curve_element_count(const struct ListBase *nurb)
int BKE_keyblock_element_count(const struct Key *key)
void key_curve_position_weights(float t, float data[4], int type)
Definition: key.c:336
bool BKE_key_idtype_support(short id_type)
Definition: key.c:1746
void BKE_keyblock_convert_from_lattice(const struct Lattice *lt, struct KeyBlock *kb)
void BKE_keyblock_curve_data_transform(const struct ListBase *nurb, const float mat[4][4], const void *src, void *dst)
_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
SyclQueue void void * src
Definition: DNA_ID.h:368
char name[64]
Definition: DNA_key_types.h:52
Definition: BKE_main.h:121