Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_conversions.c
| Context not available. | |||||
| FOREACH_TRANS_DATA_CONTAINER (t, tc) { | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| Object *ob = tc->poseobj; | Object *ob = tc->poseobj; | ||||
| bPose *pose = ob->pose; | |||||
| bArmature *arm; | bArmature *arm; | ||||
| short ik_on = 0; | short ik_on = 0; | ||||
| /* check validity of state */ | /* check validity of state */ | ||||
| arm = BKE_armature_from_object(tc->poseobj); | arm = BKE_armature_from_object(tc->poseobj); | ||||
| if ((arm == NULL) || (ob->pose == NULL)) { | if ((arm == NULL) || (pose == NULL)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| const bool mirror = ((arm->flag & ARM_MIRROR_EDIT) != 0); | const bool mirror = ((pose->flag & POSE_MIRROR_EDIT) != 0); | ||||
| /* set flags and count total */ | /* set flags and count total */ | ||||
| tc->data_len = count_set_pose_transflags(ob, t->mode, t->around, has_translate_rotate); | tc->data_len = count_set_pose_transflags(ob, t->mode, t->around, has_translate_rotate); | ||||
| Context not available. | |||||
| } | } | ||||
| /* do we need to add temporal IK chains? */ | /* do we need to add temporal IK chains? */ | ||||
| if ((arm->flag & ARM_AUTO_IK) && t->mode == TFM_TRANSLATION) { | if ((pose->flag & POSE_AUTO_IK) && t->mode == TFM_TRANSLATION) { | ||||
| ik_on = pose_grab_with_ik(bmain, ob); | ik_on = pose_grab_with_ik(bmain, ob); | ||||
| if (ik_on) { | if (ik_on) { | ||||
| t->flag |= T_AUTOIK; | t->flag |= T_AUTOIK; | ||||
| Context not available. | |||||
| PoseInitData_Mirror *pid = tc->custom.type.data; | PoseInitData_Mirror *pid = tc->custom.type.data; | ||||
| int pid_index = 0; | int pid_index = 0; | ||||
| bArmature *arm; | bPose *pose = ob->pose; | ||||
| /* check validity of state */ | if (pose == NULL) { | ||||
| arm = BKE_armature_from_object(tc->poseobj); | |||||
| if ((arm == NULL) || (ob->pose == NULL)) { | |||||
| continue; | continue; | ||||
| } | } | ||||
| const bool mirror = ((arm->flag & ARM_MIRROR_EDIT) != 0); | const bool mirror = ((pose->flag & POSE_MIRROR_EDIT) != 0); | ||||
| const bool is_mirror_relative = ((arm->flag & ARM_MIRROR_RELATIVE) != 0); | const bool is_mirror_relative = ((pose->flag & POSE_MIRROR_RELATIVE) != 0); | ||||
| tc->poseobj = ob; /* we also allow non-active objects to be transformed, in weightpaint */ | tc->poseobj = ob; /* we also allow non-active objects to be transformed, in weightpaint */ | ||||
| Context not available. | |||||
| void restoreMirrorPoseBones(TransDataContainer *tc) | void restoreMirrorPoseBones(TransDataContainer *tc) | ||||
| { | { | ||||
| bArmature *arm; | bPose *pose = tc->poseobj->pose; | ||||
| if (tc->obedit) { | |||||
| arm = tc->obedit->data; | |||||
| } | |||||
| else { | |||||
| BLI_assert(tc->poseobj != NULL); | |||||
| arm = tc->poseobj->data; | |||||
| } | |||||
| if (!(arm->flag & ARM_MIRROR_EDIT)) { | if (!(pose->flag & POSE_MIRROR_EDIT)) { | ||||
| return; | return; | ||||
| } | } | ||||
| Context not available. | |||||