Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/action.c
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "DEG_depsgraph_build.h" | #include "DEG_depsgraph_build.h" | ||||
| #include "BIK_api.h" | #include "BIK_api.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "CLG_log.h" | |||||
| static CLG_LogRef LOG = {"bke.action"}; | |||||
| /* *********************** NOTE ON POSE AND ACTION ********************** | /* *********************** NOTE ON POSE AND ACTION ********************** | ||||
| * | * | ||||
| * - Pose is the local (object level) component of armature. The current | * - Pose is the local (object level) component of armature. The current | ||||
| * object pose is saved in files, and (will be) is presorted for dependency | * object pose is saved in files, and (will be) is presorted for dependency | ||||
| * - Actions have fewer (or other) channels, and write data to a Pose | * - Actions have fewer (or other) channels, and write data to a Pose | ||||
| * - Currently ob->pose data is controlled in BKE_pose_where_is only. The (recalc) | * - Currently ob->pose data is controlled in BKE_pose_where_is only. The (recalc) | ||||
| * event system takes care of calling that | * event system takes care of calling that | ||||
| * - The NLA system (here too) uses Poses as interpolation format for Actions | * - The NLA system (here too) uses Poses as interpolation format for Actions | ||||
| ▲ Show 20 Lines • Show All 1,295 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* both poses should be in sync */ | /* both poses should be in sync */ | ||||
| bool BKE_pose_copy_result(bPose *to, bPose *from) | bool BKE_pose_copy_result(bPose *to, bPose *from) | ||||
| { | { | ||||
| bPoseChannel *pchanto, *pchanfrom; | bPoseChannel *pchanto, *pchanfrom; | ||||
| if (to == NULL || from == NULL) { | if (to == NULL || from == NULL) { | ||||
| printf("Pose copy error, pose to:%p from:%p\n", (void *)to, (void *)from); /* debug temp */ | CLOG_ERROR(&LOG, "Pose copy error, pose to:%p from:%p", (void *)to, (void *)from); /* debug temp */ | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (to == from) { | if (to == from) { | ||||
| printf("BKE_pose_copy_result source and target are the same\n"); | CLOG_ERROR(&LOG, "source and target are the same"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| for (pchanfrom = from->chanbase.first; pchanfrom; pchanfrom = pchanfrom->next) { | for (pchanfrom = from->chanbase.first; pchanfrom; pchanfrom = pchanfrom->next) { | ||||
| pchanto = BKE_pose_channel_find_name(to, pchanfrom->name); | pchanto = BKE_pose_channel_find_name(to, pchanfrom->name); | ||||
| if (pchanto != NULL) { | if (pchanto != NULL) { | ||||
| BKE_pose_copyesult_pchan_result(pchanto, pchanfrom); | BKE_pose_copyesult_pchan_result(pchanto, pchanfrom); | ||||
| } | } | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines | |||||