Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/action.c
| Show First 20 Lines • Show All 1,606 Lines • ▼ Show 20 Lines | void BKE_pose_tag_recalc(Main *bmain, bPose *pose) | ||||
| * if pose was changed depsgraph is to be updated as well. | * if pose was changed depsgraph is to be updated as well. | ||||
| */ | */ | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| /* For the calculation of the effects of an Action at the given frame on an object | /* For the calculation of the effects of an Action at the given frame on an object | ||||
| * This is currently only used for the Action Constraint | * This is currently only used for the Action Constraint | ||||
| */ | */ | ||||
| void what_does_obaction( | void what_does_obaction(Object *ob, | ||||
| Object *ob, Object *workob, bPose *pose, bAction *act, char groupname[], float cframe) | Object *workob, | ||||
| bPose *pose, | |||||
| bAction *act, | |||||
| char groupname[], | |||||
| const AnimationEvalContext *anim_eval_context) | |||||
| { | { | ||||
| bActionGroup *agrp = BKE_action_group_find_name(act, groupname); | bActionGroup *agrp = BKE_action_group_find_name(act, groupname); | ||||
| /* clear workob */ | /* clear workob */ | ||||
| BKE_object_workob_clear(workob); | BKE_object_workob_clear(workob); | ||||
| /* init workob */ | /* init workob */ | ||||
| copy_m4_m4(workob->obmat, ob->obmat); | copy_m4_m4(workob->obmat, ob->obmat); | ||||
| Show All 39 Lines | void what_does_obaction(Object *ob, | ||||
| if (agrp) { | if (agrp) { | ||||
| /* specifically evaluate this group only */ | /* specifically evaluate this group only */ | ||||
| PointerRNA id_ptr; | PointerRNA id_ptr; | ||||
| /* get RNA-pointer for the workob's ID */ | /* get RNA-pointer for the workob's ID */ | ||||
| RNA_id_pointer_create(&workob->id, &id_ptr); | RNA_id_pointer_create(&workob->id, &id_ptr); | ||||
| /* execute action for this group only */ | /* execute action for this group only */ | ||||
| animsys_evaluate_action_group(&id_ptr, act, agrp, cframe); | animsys_evaluate_action_group(&id_ptr, act, agrp, anim_eval_context); | ||||
| } | } | ||||
| else { | else { | ||||
| AnimData adt = {NULL}; | AnimData adt = {NULL}; | ||||
| /* init animdata, and attach to workob */ | /* init animdata, and attach to workob */ | ||||
| workob->adt = &adt; | workob->adt = &adt; | ||||
| adt.action = act; | adt.action = act; | ||||
| /* execute effects of Action on to workob (or it's PoseChannels) */ | /* execute effects of Action on to workob (or it's PoseChannels) */ | ||||
| BKE_animsys_evaluate_animdata(&workob->id, &adt, cframe, ADT_RECALC_ANIM, false); | BKE_animsys_evaluate_animdata(&workob->id, &adt, anim_eval_context, ADT_RECALC_ANIM, false); | ||||
| } | } | ||||
| } | } | ||||