Blender V2.61 - r43446
Defines | Functions | Variables

key.c File Reference

#include <math.h>
#include <string.h>
#include <stddef.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_animsys.h"
#include "BKE_curve.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_scene.h"
#include "RNA_access.h"

Go to the source code of this file.

Defines

#define KEY_MODE_DUMMY   0
#define KEY_MODE_BPOINT   1
#define KEY_MODE_BEZTRIPLE   2
#define IPO_FLOAT   4
#define IPO_BEZTRIPLE   100
#define IPO_BPOINT   101
#define GS(a)   (*((short *)(a)))

Functions

void free_key (Key *key)
Keyadd_key (ID *id)
Keycopy_key (Key *key)
void make_local_key (Key *key)
void sort_keys (Key *key)
void key_curve_position_weights (float t, float *data, int type)
void key_curve_tangent_weights (float t, float *data, int type)
void key_curve_normal_weights (float t, float *data, int type)
static int setkeys (float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl)
static void flerp (int tot, float *in, float *f0, float *f1, float *f2, float *f3, float *t)
static void rel_flerp (int tot, float *in, float *ref, float *out, float fac)
static char * key_block_get_data (Key *key, KeyBlock *actkb, KeyBlock *kb, char **freedata)
static short key_pointer_size (const Key *key, const int mode, int *poinsize, int *ofs)
static void cp_key (const int start, int end, const int tot, char *poin, Key *key, KeyBlock *actkb, KeyBlock *kb, float *weights, const int mode)
static void cp_cu_key (Curve *cu, Key *key, KeyBlock *actkb, KeyBlock *kb, const int start, int end, char *out, const int tot)
void do_rel_key (const int start, int end, const int tot, char *basispoin, Key *key, KeyBlock *actkb, const int mode)
static void do_key (const int start, int end, const int tot, char *poin, Key *key, KeyBlock *actkb, KeyBlock **k, float *t, const int mode)
static float * get_weights_array (Object *ob, char *vgroup)
static void do_mesh_key (Scene *scene, Object *ob, Key *key, char *out, const int tot)
static void do_cu_key (Curve *cu, Key *key, KeyBlock *actkb, KeyBlock **k, float *t, char *out, const int tot)
static void do_rel_cu_key (Curve *cu, Key *key, KeyBlock *actkb, float UNUSED(ctime), char *out, const int tot)
static void do_curve_key (Scene *scene, Object *ob, Key *key, char *out, const int tot)
static void do_latt_key (Scene *scene, Object *ob, Key *key, char *out, const int tot)
float * do_ob_key (Scene *scene, Object *ob)
Keyob_get_key (Object *ob)
KeyBlockadd_keyblock (Key *key, const char *name)
KeyBlockob_get_keyblock (Object *ob)
KeyBlockob_get_reference_keyblock (Object *ob)
KeyBlockkey_get_keyblock (Key *key, int index)
KeyBlockkey_get_named_keyblock (Key *key, const char name[])
char * key_get_curValue_rnaPath (Key *key, KeyBlock *kb)
void latt_to_key (Lattice *lt, KeyBlock *kb)
void key_to_latt (KeyBlock *kb, Lattice *lt)
void curve_to_key (Curve *cu, KeyBlock *kb, ListBase *nurb)
void key_to_curve (KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb)
void mesh_to_key (Mesh *me, KeyBlock *kb)
void key_to_mesh (KeyBlock *kb, Mesh *me)
float(* key_to_vertcos (Object *ob, KeyBlock *kb))[3]
void vertcos_to_key (Object *ob, KeyBlock *kb, float(*vertCos)[3])
void offset_to_key (Object *ob, KeyBlock *kb, float(*ofs)[3])

Variables

int slurph_opt = 1

Detailed Description

Definition in file key.c.


Define Documentation

#define GS (   a)    (*((short *)(a)))

Definition at line 103 of file key.c.

Referenced by add_key(), key_block_get_data(), and key_pointer_size().

#define IPO_BEZTRIPLE   100

Definition at line 73 of file key.c.

Referenced by cp_key(), do_key(), do_rel_key(), and switch_endian_keyblock().

#define IPO_BPOINT   101

Definition at line 74 of file key.c.

Referenced by add_key(), cp_key(), do_key(), do_rel_key(), and switch_endian_keyblock().

#define IPO_FLOAT   4

Definition at line 72 of file key.c.

Referenced by add_key(), cp_key(), do_key(), do_rel_key(), and switch_endian_keyblock().

#define KEY_MODE_BEZTRIPLE   2

Definition at line 69 of file key.c.

Referenced by cp_cu_key(), cp_key(), do_cu_key(), do_curve_key(), do_key(), do_rel_cu_key(), and do_rel_key().

#define KEY_MODE_BPOINT   1

Definition at line 68 of file key.c.

Referenced by cp_cu_key(), do_cu_key(), do_curve_key(), do_rel_cu_key(), and key_pointer_size().

#define KEY_MODE_DUMMY   0

Definition at line 67 of file key.c.

Referenced by do_latt_key(), and do_mesh_key().


Function Documentation

Key* add_key ( ID id) [read]
KeyBlock* add_keyblock ( Key key,
const char *  name 
) [read]
Key* copy_key ( Key key) [read]
static void cp_cu_key ( Curve cu,
Key key,
KeyBlock actkb,
KeyBlock kb,
const int  start,
int  end,
char *  out,
const int  tot 
) [static]
static void cp_key ( const int  start,
int  end,
const int  tot,
char *  poin,
Key key,
KeyBlock actkb,
KeyBlock kb,
float *  weights,
const int  mode 
) [static]
void curve_to_key ( Curve cu,
KeyBlock kb,
ListBase nurb 
)
static void do_cu_key ( Curve cu,
Key key,
KeyBlock actkb,
KeyBlock **  k,
float *  t,
char *  out,
const int  tot 
) [static]
static void do_curve_key ( Scene scene,
Object ob,
Key key,
char *  out,
const int  tot 
) [static]
static void do_key ( const int  start,
int  end,
const int  tot,
char *  poin,
Key key,
KeyBlock actkb,
KeyBlock **  k,
float *  t,
const int  mode 
) [static]
static void do_latt_key ( Scene scene,
Object ob,
Key key,
char *  out,
const int  tot 
) [static]
static void do_mesh_key ( Scene scene,
Object ob,
Key key,
char *  out,
const int  tot 
) [static]
float* do_ob_key ( Scene scene,
Object ob 
)
static void do_rel_cu_key ( Curve cu,
Key key,
KeyBlock actkb,
float   UNUSEDctime,
char *  out,
const int  tot 
) [static]
void do_rel_key ( const int  start,
int  end,
const int  tot,
char *  basispoin,
Key key,
KeyBlock actkb,
const int  mode 
)
static void flerp ( int  tot,
float *  in,
float *  f0,
float *  f1,
float *  f2,
float *  f3,
float *  t 
) [static]

Definition at line 473 of file key.c.

Referenced by do_key().

void free_key ( Key key)
static float* get_weights_array ( Object ob,
char *  vgroup 
) [static]
static char* key_block_get_data ( Key key,
KeyBlock actkb,
KeyBlock kb,
char **  freedata 
) [static]
void key_curve_normal_weights ( float  t,
float *  data,
int  type 
)

Definition at line 324 of file key.c.

References KEY_BSPLINE, KEY_CARDINAL, and KEY_LINEAR.

void key_curve_position_weights ( float  t,
float *  data,
int  type 
)
void key_curve_tangent_weights ( float  t,
float *  data,
int  type 
)

Definition at line 294 of file key.c.

References KEY_BSPLINE, KEY_CARDINAL, and KEY_LINEAR.

Referenced by strand_eval_point(), and where_on_path().

char* key_get_curValue_rnaPath ( Key key,
KeyBlock kb 
)
KeyBlock* key_get_keyblock ( Key key,
int  index 
) [read]

Definition at line 1502 of file key.c.

References Key::block, ListBase::first, i, KeyBlock::next, NULL, and Key::totkey.

Referenced by get_orco_coords_dm().

KeyBlock* key_get_named_keyblock ( Key key,
const char  name[] 
) [read]

Definition at line 1522 of file key.c.

References BLI_findstring(), Key::block, and NULL.

Referenced by join_mesh_exec(), and sculpt_undo_restore().

static short key_pointer_size ( const Key key,
const int  mode,
int *  poinsize,
int *  ofs 
) [static]

Definition at line 523 of file key.c.

References BLI_assert, FALSE, Key::from, GS, ID_CU, ID_LT, ID_ME, KEY_MODE_BPOINT, ID::name, NULL, and TRUE.

Referenced by cp_key(), do_key(), and do_rel_key().

void key_to_curve ( KeyBlock kb,
Curve UNUSEDcu,
ListBase nurb 
)
void key_to_latt ( KeyBlock kb,
Lattice lt 
)
void key_to_mesh ( KeyBlock kb,
Mesh me 
)
float(* key_to_vertcos ( Object ob,
KeyBlock kb 
) )[3]
void latt_to_key ( Lattice lt,
KeyBlock kb 
)
void make_local_key ( Key key)

Definition at line 175 of file key.c.

References Key::id, ID::lib, new_id(), and NULL.

Referenced by id_make_local().

void mesh_to_key ( Mesh me,
KeyBlock kb 
)
Key* ob_get_key ( Object ob) [read]
KeyBlock* ob_get_keyblock ( Object ob) [read]
KeyBlock* ob_get_reference_keyblock ( Object ob) [read]

Definition at line 1491 of file key.c.

References NULL, ob_get_key(), and Key::refkey.

void offset_to_key ( Object ob,
KeyBlock kb,
float(*)  ofs[3] 
)
static void rel_flerp ( int  tot,
float *  in,
float *  ref,
float *  out,
float  fac 
) [static]

Definition at line 482 of file key.c.

Referenced by cp_key(), and do_rel_key().

static int setkeys ( float  fac,
ListBase lb,
KeyBlock k[],
float *  t,
int  cycl 
) [static]
void sort_keys ( Key key)
void vertcos_to_key ( Object ob,
KeyBlock kb,
float(*)  vertCos[3] 
)

Variable Documentation

int slurph_opt = 1

Definition at line 76 of file key.c.

Referenced by database_fromscene_vectors(), do_curve_key(), do_mesh_key(), and RE_Database_FromScene().