|
Blender
V2.59
|
00001 /* 00002 * $Id: BKE_key.h 34962 2011-02-18 13:05:18Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00021 * All rights reserved. 00022 * 00023 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): none yet. 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 #ifndef BKE_KEY_H 00030 #define BKE_KEY_H 00031 00037 struct Key; 00038 struct KeyBlock; 00039 struct ID; 00040 struct ListBase; 00041 struct Curve; 00042 struct Object; 00043 struct Scene; 00044 struct Lattice; 00045 struct Mesh; 00046 00047 /* Kernel prototypes */ 00048 #ifdef __cplusplus 00049 extern "C" { 00050 #endif 00051 00052 void free_key(struct Key *sc); 00053 struct Key *add_key(struct ID *id); 00054 struct Key *copy_key(struct Key *key); 00055 void make_local_key(struct Key *key); 00056 void sort_keys(struct Key *key); 00057 00058 void key_curve_position_weights(float t, float *data, int type); 00059 void key_curve_tangent_weights(float t, float *data, int type); 00060 void key_curve_normal_weights(float t, float *data, int type); 00061 00062 float *do_ob_key(struct Scene *scene, struct Object *ob); 00063 00064 struct Key *ob_get_key(struct Object *ob); 00065 struct KeyBlock *add_keyblock(struct Key *key, const char *name); 00066 struct KeyBlock *ob_get_keyblock(struct Object *ob); 00067 struct KeyBlock *ob_get_reference_keyblock(struct Object *ob); 00068 struct KeyBlock *key_get_keyblock(struct Key *key, int index); 00069 struct KeyBlock *key_get_named_keyblock(struct Key *key, const char name[]); 00070 char *key_get_curValue_rnaPath(struct Key *key, struct KeyBlock *kb); 00071 // needed for the GE 00072 void do_rel_key(const int start, int end, const int tot, char *basispoin, struct Key *key, struct KeyBlock *actkb, const int mode); 00073 00074 /* conversion functions */ 00075 void key_to_mesh(struct KeyBlock *kb, struct Mesh *me); 00076 void mesh_to_key(struct Mesh *me, struct KeyBlock *kb); 00077 void key_to_latt(struct KeyBlock *kb, struct Lattice *lt); 00078 void latt_to_key(struct Lattice *lt, struct KeyBlock *kb); 00079 void key_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb); 00080 void curve_to_key(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb); 00081 float (*key_to_vertcos(struct Object *ob, struct KeyBlock *kb))[3]; 00082 void vertcos_to_key(struct Object *ob, struct KeyBlock *kb, float (*vertCos)[3]); 00083 void offset_to_key(struct Object *ob, struct KeyBlock *kb, float (*ofs)[3]); 00084 00085 /* key.c */ 00086 extern int slurph_opt; 00087 00088 #ifdef __cplusplus 00089 }; 00090 #endif 00091 00092 #endif // BKE_KEY_H