Blender
V3.3
|
#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_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
#include "IK_solver.h"
#include "iksolver_plugin.h"
#include <string.h>
Go to the source code of this file.
Macros | |
#define | USE_NONUNIFORM_SCALE |
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][3]) |
static void | execute_posetree (struct Depsgraph *depsgraph, struct Scene *scene, Object *ob, PoseTree *tree) |
static void | free_posetree (PoseTree *tree) |
void | iksolver_initialize_tree (struct Depsgraph *UNUSED(depsgraph), struct Scene *UNUSED(scene), struct Object *ob, float UNUSED(ctime)) |
void | iksolver_execute_tree (struct Depsgraph *depsgraph, struct Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime) |
void | iksolver_release_tree (struct Scene *UNUSED(scene), struct Object *ob, float UNUSED(ctime)) |
void | iksolver_clear_data (bPose *pose) |
#define USE_NONUNIFORM_SCALE |
Definition at line 28 of file iksolver_plugin.c.
|
static |
Called from within the core BKE_pose_where_is loop, all animation-systems and constraints were executed & assigned. Now as last we do an IK pass.
Definition at line 262 of file iksolver_plugin.c.
References Freestyle::a, BKE_constraint_target_matrix_get(), 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_POS, CONSTRAINT_IK_ROT, CONSTRAINT_IK_SETANGLE, CONSTRAINT_OBTYPE_OBJECT, copy_m3_m3(), copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), data, bConstraint::data, depsgraph, bConstraint::enforce, if(), 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_STRETCH_STIFF_MAX, IK_STRETCH_STIFF_MIN, 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(), len_v3(), blender::math::length(), Bone::length, bPoseChannel::limitmax, bPoseChannel::limitmin, mat3_to_quat(), mat4_to_quat(), MEM_freeN, MEM_mallocN, mul_m3_m3m3(), mul_m3_v3(), mul_m4_m4m4(), mul_m4_series, mul_v3_fl(), PoseTarget::next, normalize_m3(), normalize_m4(), NULL, Object::obmat, bPoseChannel::parent, bKinematicConstraint::poleangle, bPoseChannel::pose_head, bPoseChannel::pose_mat, bPoseChannel::pose_tail, q1, quat_to_mat3(), scene, square_f(), bPoseChannel::stiffness, sub_v3_v3v3(), PoseTarget::tip, transpose_m3_m3(), tree, unit_m3(), and unit_m4().
Referenced by iksolver_execute_tree().
Definition at line 556 of file iksolver_plugin.c.
References BLI_freelistN(), MEM_freeN, and tree.
Referenced by iksolver_clear_data(), and iksolver_execute_tree().
Definition at line 639 of file iksolver_plugin.c.
References BLI_remlink(), bPose::chanbase, CONSTRAINT_TYPE_KINEMATIC, free_posetree(), LISTBASE_FOREACH, POSE_IKTREE, and tree.
Referenced by iksolver_release_tree().
void iksolver_execute_tree | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
Object * | ob, | ||
bPoseChannel * | pchan_root, | ||
float | ctime | ||
) |
Definition at line 589 of file iksolver_plugin.c.
References Freestyle::a, BKE_pose_where_is_bone(), BLI_remlink(), CONSTRAINT_TYPE_KINEMATIC, depsgraph, execute_posetree(), ListBase::first, free_posetree(), bPoseChannel::iktree, make_dmats(), POSE_CHAIN, POSE_DONE, scene, tree, and where_is_ik_bone().
void iksolver_initialize_tree | ( | struct Depsgraph * | UNUSEDdepsgraph, |
struct Scene * | UNUSEDscene, | ||
struct Object * | ob, | ||
float | UNUSEDctime | ||
) |
Definition at line 574 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.
Definition at line 634 of file iksolver_plugin.c.
References iksolver_clear_data(), and Object::pose.
|
static |
Definition at line 35 of file iksolver_plugin.c.
References Freestyle::a, 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, bPoseChannel::flag, bConstraint::flag, if(), bPoseChannel::iktree, MAX2, MEM_callocN, MEM_freeN, MIN2, PoseTarget::next, bConstraint::next, NULL, OB_ARMATURE, bPoseChannel::parent, POSE_CHAIN, POSE_IKTREE, size(), t, PoseTarget::tip, tree, and bConstraint::type.
Referenced by iksolver_initialize_tree().
|
static |
Definition at line 201 of file iksolver_plugin.c.
References bPoseChannel::chan_mat, copy_m4_m4(), invert_m4_m4(), mul_m4_m4m4(), bPoseChannel::parent, and bPoseChannel::pose_mat.
Referenced by iksolver_execute_tree().
|
static |
Definition at line 216 of file iksolver_plugin.c.
References add_v3_v3v3(), bPoseChannel::bone, bPoseChannel::chan_mat, copy_m4_m3(), copy_m4_m4(), copy_v3_v3(), bPoseChannel::flag, Bone::length, mat3_to_size(), mat4_to_size(), mul_m4_m4m4(), mul_v3_fl(), normalize_v3_length(), bPoseChannel::parent, POSE_DONE, bPoseChannel::pose_head, bPoseChannel::pose_mat, and bPoseChannel::pose_tail.
Referenced by iksolver_execute_tree().