Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

armature.c File Reference

#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "BLI_bpath.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_mesh_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_nla_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_action.h"
#include "BKE_anim.h"
#include "BKE_constraint.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
#include "BKE_DerivedMesh.h"
#include "BKE_deform.h"
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_library.h"
#include "BKE_lattice.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_scene.h"
#include "BIK_api.h"
#include "BKE_sketch.h"

Go to the source code of this file.

Classes

struct  bPoseChanDeform
struct  tSplineIK_Tree

Defines

#define MAX_BBONE_SUBDIV   32

Typedefs

typedef struct bPoseChanDeform bPoseChanDeform
typedef struct tSplineIK_Tree tSplineIK_Tree

Functions

bArmatureadd_armature (const char *name)
bArmatureget_armature (Object *ob)
void free_bonelist (ListBase *lb)
void free_armature (bArmature *arm)
void make_local_armature (bArmature *arm)
static void copy_bonechildren (Bone *newBone, Bone *oldBone, Bone *actBone, Bone **newActBone)
bArmaturecopy_armature (bArmature *arm)
static Boneget_named_bone_bonechildren (Bone *bone, const char *name)
Boneget_named_bone (bArmature *arm, const char *name)
int bone_autoside_name (char name[MAXBONENAME], int UNUSED(strip_number), short axis, float head, float tail)
static void equalize_bezier (float *data, int desired)
Mat4b_bone_spline_setup (bPoseChannel *pchan, int rest)
static void pchan_b_bone_defmats (bPoseChannel *pchan, bPoseChanDeform *pdef_info, int use_quaternion)
static void b_bone_deform (bPoseChanDeform *pdef_info, Bone *bone, float *co, DualQuat *dq, float defmat[][3])
float distfactor_to_bone (float vec[3], float b1[3], float b2[3], float rad1, float rad2, float rdist)
static void pchan_deform_mat_add (bPoseChannel *pchan, float weight, float bbonemat[][3], float mat[][3])
static float dist_bone_deform (bPoseChannel *pchan, bPoseChanDeform *pdef_info, float *vec, DualQuat *dq, float mat[][3], float *co)
static void pchan_bone_deform (bPoseChannel *pchan, bPoseChanDeform *pdef_info, float weight, float *vec, DualQuat *dq, float mat[][3], float *co, float *contrib)
void armature_deform_verts (Object *armOb, Object *target, DerivedMesh *dm, float(*vertexCos)[3], float(*defMats)[3][3], int numVerts, int deformflag, float(*prevCos)[3], const char *defgrp_name)
void get_objectspace_bone_matrix (struct Bone *bone, float M_accumulatedMatrix[][4], int UNUSED(root), int UNUSED(posed))
void armature_mat_world_to_pose (Object *ob, float inmat[][4], float outmat[][4])
void armature_loc_world_to_pose (Object *ob, float *inloc, float *outloc)
void armature_mat_pose_to_bone (bPoseChannel *pchan, float inmat[][4], float outmat[][4])
void armature_loc_pose_to_bone (bPoseChannel *pchan, float *inloc, float *outloc)
void pchan_mat3_to_rot (bPoseChannel *pchan, float mat[][3], short use_compat)
void pchan_apply_mat4 (bPoseChannel *pchan, float mat[][4], short use_compat)
void armature_mat_pose_to_delta (float delta_mat[][4], float pose_mat[][4], float arm_mat[][4])
void BKE_rotMode_change_values (float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
void mat3_to_vec_roll (float mat[][3], float *vec, float *roll)
void vec_roll_to_mat3 (float *vec, float roll, float mat[][3])
void where_is_armature_bone (Bone *bone, Bone *prevbone)
void where_is_armature (bArmature *arm)
static void pose_proxy_synchronize (Object *ob, Object *from, int layer_protected)
static int rebuild_pose_bone (bPose *pose, Bone *bone, bPoseChannel *parchan, int counter)
void armature_rebuild_pose (Object *ob, bArmature *arm)
static void splineik_init_tree_from_pchan (Scene *scene, Object *UNUSED(ob), bPoseChannel *pchan_tip)
static void splineik_init_tree (Scene *scene, Object *ob, float UNUSED(ctime))
static void splineik_evaluate_bone (tSplineIK_Tree *tree, Scene *scene, Object *ob, bPoseChannel *pchan, int index, float ctime)
static void splineik_execute_tree (Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime)
void pchan_to_mat4 (bPoseChannel *pchan, float chan_mat[4][4])
void pchan_calc_mat (bPoseChannel *pchan)
void where_is_pose_bone_tail (bPoseChannel *pchan)
void where_is_pose_bone (Scene *scene, Object *ob, bPoseChannel *pchan, float ctime, int do_extra)
void where_is_pose (Scene *scene, Object *ob)
int get_selected_defgroups (Object *ob, char *dg_selection, int defbase_tot)

Detailed Description

Definition in file armature.c.


Define Documentation

#define MAX_BBONE_SUBDIV   32

Definition at line 381 of file armature.c.

Referenced by b_bone_spline_setup(), and equalize_bezier().


Typedef Documentation


Function Documentation

bArmature* add_armature ( const char *  name) [read]
void armature_deform_verts ( Object armOb,
Object target,
DerivedMesh dm,
float(*)  vertexCos[3],
float(*)  defMats[3][3],
int  numVerts,
int  deformflag,
float(*)  prevCos[3],
const char *  defgrp_name 
)
void armature_loc_pose_to_bone ( bPoseChannel pchan,
float *  inloc,
float *  outloc 
)

Definition at line 1192 of file armature.c.

References armature_mat_pose_to_bone(), copy_v3_v3(), and MAT4_UNITY.

void armature_loc_world_to_pose ( Object ob,
float *  inloc,
float *  outloc 
)

Definition at line 1113 of file armature.c.

References armature_mat_world_to_pose(), copy_v3_v3(), and MAT4_UNITY.

void armature_mat_pose_to_bone ( bPoseChannel pchan,
float  inmat[][4],
float  outmat[][4] 
)
void armature_mat_pose_to_delta ( float  delta_mat[][4],
float  pose_mat[][4],
float  arm_mat[][4] 
)

Definition at line 1235 of file armature.c.

References invert_m4_m4(), and mult_m4_m4m4().

void armature_mat_world_to_pose ( Object ob,
float  inmat[][4],
float  outmat[][4] 
)

Definition at line 1095 of file armature.c.

References invert_m4_m4(), mult_m4_m4m4(), NULL, and Object::obmat.

Referenced by armature_loc_world_to_pose().

void armature_rebuild_pose ( Object ob,
bArmature arm 
)
static void b_bone_deform ( bPoseChanDeform pdef_info,
Bone bone,
float *  co,
DualQuat dq,
float  defmat[][3] 
) [static]
Mat4* b_bone_spline_setup ( bPoseChannel pchan,
int  rest 
)
void BKE_rotMode_change_values ( float  quat[4],
float  eul[3],
float  axis[3],
float *  angle,
short  oldMode,
short  newMode 
)
int bone_autoside_name ( char  name[MAXBONENAME],
int   UNUSEDstrip_number,
short  axis,
float  head,
float  tail 
)

Definition at line 267 of file armature.c.

References BLI_snprintf(), BLI_strncpy(), IS_EQ, len(), MAXBONENAME, and strlen().

bArmature* copy_armature ( bArmature arm) [read]
static void copy_bonechildren ( Bone newBone,
Bone oldBone,
Bone actBone,
Bone **  newActBone 
) [static]
static float dist_bone_deform ( bPoseChannel pchan,
bPoseChanDeform pdef_info,
float *  vec,
DualQuat dq,
float  mat[][3],
float *  co 
) [static]
float distfactor_to_bone ( float  vec[3],
float  b1[3],
float  b2[3],
float  rad1,
float  rad2,
float  rdist 
)

Definition at line 668 of file armature.c.

References F, normalize_v3(), sqrt(), and sub_v3_v3v3().

Referenced by armature_deform_verts(), dist_bone_deform(), and envelope_bone_weighting().

static void equalize_bezier ( float *  data,
int  desired 
) [static]

Definition at line 384 of file armature.c.

References copy_qt_qt(), len_v3v3(), and MAX_BBONE_SUBDIV.

Referenced by b_bone_spline_setup().

void free_armature ( bArmature arm)
void free_bonelist ( ListBase lb)
bArmature* get_armature ( Object ob) [read]
Bone* get_named_bone ( bArmature arm,
const char *  name 
) [read]
static Bone* get_named_bone_bonechildren ( Bone bone,
const char *  name 
) [static]

Definition at line 227 of file armature.c.

References Bone::childbase, ListBase::first, Bone::name, Bone::next, and NULL.

Referenced by get_named_bone().

void get_objectspace_bone_matrix ( struct Bone bone,
float  M_accumulatedMatrix[][4],
int   UNUSEDroot,
int   UNUSEDposed 
)

Definition at line 1087 of file armature.c.

References Bone::arm_mat, and copy_m4_m4().

int get_selected_defgroups ( Object ob,
char *  dg_selection,
int  defbase_tot 
)
void make_local_armature ( bArmature arm)
void mat3_to_vec_roll ( float  mat[][3],
float *  vec,
float *  roll 
)
void pchan_apply_mat4 ( bPoseChannel pchan,
float  mat[][4],
short  use_compat 
)
static void pchan_b_bone_defmats ( bPoseChannel pchan,
bPoseChanDeform pdef_info,
int  use_quaternion 
) [static]
static void pchan_bone_deform ( bPoseChannel pchan,
bPoseChanDeform pdef_info,
float  weight,
float *  vec,
DualQuat dq,
float  mat[][3],
float *  co,
float *  contrib 
) [static]
void pchan_calc_mat ( bPoseChannel pchan)

Definition at line 2116 of file armature.c.

References bPoseChannel::chan_mat, and pchan_to_mat4().

Referenced by actcon_get_tarmat(), and where_is_pose_bone().

static void pchan_deform_mat_add ( bPoseChannel pchan,
float  weight,
float  bbonemat[][3],
float  mat[][3] 
) [static]
void pchan_mat3_to_rot ( bPoseChannel pchan,
float  mat[][3],
short  use_compat 
)
void pchan_to_mat4 ( bPoseChannel pchan,
float  chan_mat[4][4] 
)
static void pose_proxy_synchronize ( Object ob,
Object from,
int  layer_protected 
) [static]
static int rebuild_pose_bone ( bPose pose,
Bone bone,
bPoseChannel parchan,
int  counter 
) [static]
static void splineik_evaluate_bone ( tSplineIK_Tree tree,
Scene scene,
Object ob,
bPoseChannel pchan,
int  index,
float  ctime 
) [static]
static void splineik_execute_tree ( Scene scene,
Object ob,
bPoseChannel pchan_root,
float  ctime 
) [static]
static void splineik_init_tree ( Scene scene,
Object ob,
float   UNUSEDctime 
) [static]
static void splineik_init_tree_from_pchan ( Scene scene,
Object UNUSEDob,
bPoseChannel pchan_tip 
) [static]
void vec_roll_to_mat3 ( float *  vec,
float  roll,
float  mat[][3] 
)
void where_is_armature ( bArmature arm)

Definition at line 1429 of file armature.c.

References bArmature::bonebase, ListBase::first, Bone::next, NULL, and where_is_armature_bone().

Referenced by do_versions().

void where_is_armature_bone ( Bone bone,
Bone prevbone 
)
void where_is_pose ( Scene scene,
Object ob 
)
void where_is_pose_bone ( Scene scene,
Object ob,
bPoseChannel pchan,
float  ctime,
int  do_extra 
)
void where_is_pose_bone_tail ( bPoseChannel pchan)