Blender V2.61 - r43446
|
#include "MEM_guardedalloc.h"
#include "BIK_api.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_armature.h"
#include "BKE_constraint.h"
#include "DNA_object_types.h"
#include "DNA_action_types.h"
#include "DNA_constraint_types.h"
#include "DNA_armature_types.h"
#include "IK_solver.h"
#include "iksolver_plugin.h"
#include <string.h>
Go to the source code of this file.
Functions | |
static void | initialize_posetree (struct Object *UNUSED(ob), bPoseChannel *pchan_tip) |
static void | make_dmats (bPoseChannel *pchan) |
static void | where_is_ik_bone (bPoseChannel *pchan, float ik_mat[][3]) |
static void | execute_posetree (struct Scene *scene, Object *ob, PoseTree *tree) |
static void | free_posetree (PoseTree *tree) |
void | iksolver_initialize_tree (struct Scene *UNUSED(scene), struct Object *ob, float UNUSED(ctime)) |
void | iksolver_execute_tree (struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime) |
Definition in file iksolver_plugin.c.
Definition at line 234 of file iksolver_plugin.c.
References PoseTree::basis_change, blend_m3_m3m3(), bPoseChannel::bone, BONE_IK_NO_XDOF, BONE_IK_NO_XDOF_TEMP, BONE_IK_NO_YDOF, BONE_IK_NO_YDOF_TEMP, BONE_IK_NO_ZDOF, BONE_IK_NO_ZDOF_TEMP, BONE_IK_XLIMIT, BONE_IK_YLIMIT, BONE_IK_ZLIMIT, Bone::bone_mat, PoseTarget::con, CONSTRAINT_IK_AUTO, CONSTRAINT_IK_GETANGLE, CONSTRAINT_IK_ROT, CONSTRAINT_IK_SETANGLE, CONSTRAINT_OBTYPE_OBJECT, copy_m3_m3(), copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), data, bConstraint::data, bConstraint::enforce, ListBase::first, bKinematicConstraint::flag, get_constraint_target_matrix(), IK_CreateSegment(), IK_CreateSolver(), IK_FreeSegment(), IK_FreeSolver(), IK_GetBasisChange(), IK_GetTranslationChange(), IK_SetLimit(), IK_SetParent(), IK_SetStiffness(), IK_SetTransform(), IK_Solve(), IK_SolverAddGoal(), IK_SolverAddGoalOrientation(), IK_SolverGetPoleAngle(), IK_SolverSetPoleVectorConstraint(), IK_TRANS_Y, IK_TRANS_YDOF, IK_X, IK_XDOF, IK_Y, IK_YDOF, IK_Z, IK_ZDOF, bPoseChannel::ikflag, bPoseChannel::ikstretch, interp_qt_qtqt(), invert_m3_m3(), invert_m4_m4(), PoseTree::iterations, len_v3(), length(), Bone::length, bPoseChannel::limitmax, bPoseChannel::limitmin, mat3_to_quat(), mat4_to_quat(), MEM_freeN(), MEM_mallocN(), MIN2, mul_m3_m3m3(), mul_m3_v3(), mul_serie_m4(), mul_v3_fl(), mult_m4_m4m4(), PoseTarget::next, normalize_m3(), NULL, Object::obmat, bKinematicConstraint::orientweight, PoseTree::parent, bPoseChannel::parent, PoseTree::pchan, bKinematicConstraint::poleangle, bKinematicConstraint::poletar, bPoseChannel::pose_head, bPoseChannel::pose_mat, bPoseChannel::pose_tail, quat_to_mat3(), bPoseChannel::stiffness, PoseTree::stretch, sub_v3_v3v3(), PoseTree::targets, PoseTarget::tip, PoseTree::totchannel, transpose_m3(), unit_m3(), unit_m4(), and bKinematicConstraint::weight.
Referenced by iksolver_execute_tree().
static void free_posetree | ( | PoseTree * | tree | ) | [static] |
Definition at line 498 of file iksolver_plugin.c.
References PoseTree::basis_change, BLI_freelistN(), MEM_freeN(), PoseTree::parent, PoseTree::pchan, and PoseTree::targets.
Referenced by iksolver_execute_tree().
void iksolver_execute_tree | ( | struct Scene * | scene, |
struct Object * | ob, | ||
struct bPoseChannel * | pchan, | ||
float | ctime | ||
) |
Definition at line 521 of file iksolver_plugin.c.
References PoseTree::basis_change, BLI_remlink(), CONSTRAINT_TYPE_KINEMATIC, execute_posetree(), ListBase::first, bPoseChannel::flag, free_posetree(), bPoseChannel::iktree, make_dmats(), PoseTree::pchan, POSE_CHAIN, POSE_DONE, PoseTree::totchannel, PoseTree::type, where_is_ik_bone(), and where_is_pose_bone().
---------------------------------------- Plugin API for legacy iksolver
Definition at line 510 of file iksolver_plugin.c.
References bPose::chanbase, bPoseChannel::constflag, ListBase::first, bPose::flag, initialize_posetree(), bPoseChannel::next, PCHAN_HAS_IK, Object::pose, and POSE_WAS_REBUILT.
static void initialize_posetree | ( | struct Object * | UNUSEDob, |
bPoseChannel * | pchan_tip | ||
) | [static] |
Definition at line 58 of file iksolver_plugin.c.
References BLI_addtail(), BLI_remlink(), PoseTarget::con, CONSTRAINT_DISABLE, CONSTRAINT_IK_AUTO, CONSTRAINT_IK_STRETCH, CONSTRAINT_IK_TIP, CONSTRAINT_OFF, CONSTRAINT_TYPE_KINEMATIC, bPoseChannel::constraints, data, bConstraint::data, bConstraint::enforce, ListBase::first, bConstraint::flag, bPoseChannel::flag, bKinematicConstraint::flag, if(), bPoseChannel::iktree, PoseTree::iterations, bKinematicConstraint::iterations, MAX2, MEM_callocN(), MEM_freeN(), MIN2, bConstraint::next, PoseTarget::next, PoseTree::next, NULL, OB_ARMATURE, PoseTree::parent, bPoseChannel::parent, PoseTree::pchan, POSE_CHAIN, POSE_IKTREE, bKinematicConstraint::rootbone, size(), PoseTree::stretch, bKinematicConstraint::subtarget, bKinematicConstraint::tar, PoseTree::targets, PoseTarget::tip, PoseTree::totchannel, bConstraint::type, Object::type, and PoseTree::type.
Referenced by iksolver_initialize_tree().
static void make_dmats | ( | bPoseChannel * | pchan | ) | [static] |
Definition at line 197 of file iksolver_plugin.c.
References bPoseChannel::chan_mat, copy_m4_m4(), invert_m4_m4(), mult_m4_m4m4(), bPoseChannel::parent, and bPoseChannel::pose_mat.
Referenced by iksolver_execute_tree().
static void where_is_ik_bone | ( | bPoseChannel * | pchan, |
float | ik_mat[][3] | ||
) | [static] |
Definition at line 210 of file iksolver_plugin.c.
References add_v3_v3v3(), bPoseChannel::bone, bPoseChannel::chan_mat, copy_m4_m3(), copy_v3_v3(), bPoseChannel::flag, Bone::length, mul_serie_m4(), mul_v3_fl(), mult_m4_m4m4(), NULL, bPoseChannel::parent, POSE_DONE, bPoseChannel::pose_head, bPoseChannel::pose_mat, and bPoseChannel::pose_tail.
Referenced by iksolver_execute_tree().