void BKE_pose_eval_init(EvaluationContext *UNUSED(eval_ctx),
                        Scene *scene,
                        Object *ob,
                        bPose *pose)
{
	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
	bPoseChannel *pchan;

	DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);

	BLI_assert(ob->type == OB_ARMATURE);

	/* We demand having proper pose. */
	BLI_assert(ob->pose != NULL);
	BLI_assert((ob->pose->flag & POSE_RECALC) == 0);

	/* imat is needed for solvers. */
	invert_m4_m4(ob->imat, ob->obmat);

	/* 1. clear flags */
	for (pchan = pose->chanbase.first; pchan != NULL; pchan = pchan->next) {
		pchan->flag &= ~(POSE_DONE | POSE_CHAIN | POSE_IKTREE | POSE_IKSPLINE);
	}

	/* 2a. construct the IK tree (standard IK) */
	BIK_initialize_tree(scene, ob, ctime);

	/* 2b. construct the Spline IK trees
	 *  - this is not integrated as an IK plugin, since it should be able
	 *	  to function in conjunction with standard IK
	 */
	BKE_pose_splineik_init_tree(scene, ob, ctime);
}
Beispiel #2
0
void BKE_pose_eval_init_ik(EvaluationContext *UNUSED(eval_ctx),
                           Scene *scene,
                           Object *ob,
                           bPose *UNUSED(pose))
{
	DEG_debug_print_eval(__func__, ob->id.name, ob);
	BLI_assert(ob->type == OB_ARMATURE);
	const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
	bArmature *arm = (bArmature *)ob->data;
	if (arm->flag & ARM_RESTPOS) {
		return;
	}
	/* 2a. construct the IK tree (standard IK) */
	BIK_initialize_tree(scene, ob, ctime);
	/* 2b. construct the Spline IK trees
	 *  - this is not integrated as an IK plugin, since it should be able
	 *	  to function in conjunction with standard IK
	 */
	BKE_pose_splineik_init_tree(scene, ob, ctime);
}