Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/action.c
| Show First 20 Lines • Show All 1,507 Lines • ▼ Show 20 Lines | short action_get_item_transforms(bAction *act, Object *ob, bPoseChannel *pchan, ListBase *curves) | ||||
| /* return flags found */ | /* return flags found */ | ||||
| return flags; | return flags; | ||||
| } | } | ||||
| /* ************** Pose Management Tools ****************** */ | /* ************** Pose Management Tools ****************** */ | ||||
| /* for do_all_pose_actions, clears the pose. Now also exported for proxy and tools */ | /* for do_all_pose_actions, clears the pose. Now also exported for proxy and tools */ | ||||
| void BKE_pose_rest(bPose *pose) | void BKE_pose_rest(bPose *pose, bool selected_only) | ||||
sybren: The comment ("the pose") and the implementation ("maybe not all of the pose") are out of sync. | |||||
sybrenUnsubmitted Not Done Inline ActionsIt's unclear what selected_only refers to. selected_bones_only seems better to me. sybren: It's unclear what `selected_only` refers to. `selected_bones_only` seems better to me.
| |||||
| { | { | ||||
| bPoseChannel *pchan; | bPoseChannel *pchan; | ||||
| if (!pose) { | if (!pose) { | ||||
| return; | return; | ||||
| } | } | ||||
| memset(pose->stride_offset, 0, sizeof(pose->stride_offset)); | memset(pose->stride_offset, 0, sizeof(pose->stride_offset)); | ||||
| memset(pose->cyclic_offset, 0, sizeof(pose->cyclic_offset)); | memset(pose->cyclic_offset, 0, sizeof(pose->cyclic_offset)); | ||||
| for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { | for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { | ||||
| if (selected_only && (pchan->bone != NULL) && (pchan->bone->flag & BONE_SELECTED) == 0) { | |||||
sybrenUnsubmitted Done Inline ActionsParentheses are unnecessary here. sybren: Parentheses are unnecessary here. | |||||
HooglyBooglyAuthorUnsubmitted Done Inline ActionsRight, I usually do that just to make it more readable, but I don't feel strongly about it. HooglyBoogly: Right, I usually do that just to make it more readable, but I don't feel strongly about it. | |||||
| continue; | |||||
| } | |||||
| zero_v3(pchan->loc); | zero_v3(pchan->loc); | ||||
| zero_v3(pchan->eul); | zero_v3(pchan->eul); | ||||
| unit_qt(pchan->quat); | unit_qt(pchan->quat); | ||||
| unit_axis_angle(pchan->rotAxis, &pchan->rotAngle); | unit_axis_angle(pchan->rotAxis, &pchan->rotAngle); | ||||
| pchan->size[0] = pchan->size[1] = pchan->size[2] = 1.0f; | pchan->size[0] = pchan->size[1] = pchan->size[2] = 1.0f; | ||||
| pchan->roll1 = pchan->roll2 = 0.0f; | pchan->roll1 = pchan->roll2 = 0.0f; | ||||
| pchan->curve_in_x = pchan->curve_in_y = 0.0f; | pchan->curve_in_x = pchan->curve_in_y = 0.0f; | ||||
| ▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines | |||||
The comment ("the pose") and the implementation ("maybe not all of the pose") are out of sync.
Give the state of the comment, I'd say just rewrite it. "Now also ..." doesn't make much sense, and neither does "for do_all_pose_actions" (there is no mention of "do_all_pose_actions" anywhere else in the code).