Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/armature_update.c
| Show First 20 Lines • Show All 599 Lines • ▼ Show 20 Lines | void BKE_pose_eval_init(struct Depsgraph *depsgraph, | ||||
| BLI_assert((object->pose->flag & POSE_RECALC) == 0); | BLI_assert((object->pose->flag & POSE_RECALC) == 0); | ||||
| /* imat is needed for solvers. */ | /* imat is needed for solvers. */ | ||||
| invert_m4_m4(object->imat, object->obmat); | invert_m4_m4(object->imat, object->obmat); | ||||
| /* clear flags */ | /* clear flags */ | ||||
| for (bPoseChannel *pchan = pose->chanbase.first; pchan != NULL; pchan = pchan->next) { | for (bPoseChannel *pchan = pose->chanbase.first; pchan != NULL; pchan = pchan->next) { | ||||
| pchan->flag &= ~(POSE_DONE | POSE_CHAIN | POSE_IKTREE | POSE_IKSPLINE); | pchan->flag &= ~(POSE_DONE | POSE_CHAIN | POSE_IKTREE | POSE_IKSPLINE); | ||||
| /* Free B-Bone shape data cache if it's not a B-Bone. */ | |||||
| if (pchan->bone == NULL || pchan->bone->segments <= 1) { | |||||
| BKE_pose_channel_free_bbone_cache(pchan); | |||||
| } | |||||
| } | } | ||||
| pose_pchan_index_create(pose); | pose_pchan_index_create(pose); | ||||
| BKE_armature_cached_bbone_deformation_free_data(object); | BKE_armature_cached_bbone_deformation_free_data(object); | ||||
| } | } | ||||
| void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph, | void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph, | ||||
| Scene *scene, | Scene *scene, | ||||
| ▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | if (DEG_is_active(depsgraph) && arm->edbo == NULL) { | ||||
| copy_m4_m4(pchan_orig->pose_mat, pchan->pose_mat); | copy_m4_m4(pchan_orig->pose_mat, pchan->pose_mat); | ||||
| copy_m4_m4(pchan_orig->chan_mat, pchan->chan_mat); | copy_m4_m4(pchan_orig->chan_mat, pchan->chan_mat); | ||||
| copy_v3_v3(pchan_orig->pose_head, pchan->pose_mat[3]); | copy_v3_v3(pchan_orig->pose_head, pchan->pose_mat[3]); | ||||
| copy_m4_m4(pchan_orig->constinv, pchan->constinv); | copy_m4_m4(pchan_orig->constinv, pchan->constinv); | ||||
| BKE_pose_where_is_bone_tail(pchan_orig); | BKE_pose_where_is_bone_tail(pchan_orig); | ||||
| } | } | ||||
| } | } | ||||
| void BKE_pose_eval_bbone_segments(struct Depsgraph *depsgraph, | |||||
| struct Object *ob, | |||||
| int pchan_index) | |||||
| { | |||||
| bPoseChannel *pchan = pose_pchan_get_indexed(ob, pchan_index); | |||||
| DEG_debug_print_eval(depsgraph, __func__, pchan->name, pchan); | |||||
| if (pchan->bone != NULL && pchan->bone->segments > 1) { | |||||
| BKE_pchan_cache_bbone_segments(pchan); | |||||
| } | |||||
| } | |||||
| void BKE_pose_iktree_evaluate(struct Depsgraph *depsgraph, | void BKE_pose_iktree_evaluate(struct Depsgraph *depsgraph, | ||||
| Scene *scene, | Scene *scene, | ||||
| Object *ob, | Object *ob, | ||||
| int rootchan_index) | int rootchan_index) | ||||
| { | { | ||||
| bPoseChannel *rootchan = pose_pchan_get_indexed(ob, rootchan_index); | bPoseChannel *rootchan = pose_pchan_get_indexed(ob, rootchan_index); | ||||
| DEG_debug_print_eval_subdata( | DEG_debug_print_eval_subdata( | ||||
| depsgraph, __func__, ob->id.name, ob, "rootchan", rootchan->name, rootchan); | depsgraph, __func__, ob->id.name, ob, "rootchan", rootchan->name, rootchan); | ||||
| ▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines | |||||