Blender V2.61 - r43446

BKE_key.h

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