Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert.c
| Show First 20 Lines • Show All 446 Lines • ▼ Show 20 Lines | static void bone_children_clear_transflag(int mode, short around, ListBase *lb) | ||||
| } | } | ||||
| } | } | ||||
| /* sets transform flags in the bones | /* sets transform flags in the bones | ||||
| * returns total number of bones with BONE_TRANSFORM */ | * returns total number of bones with BONE_TRANSFORM */ | ||||
| int count_set_pose_transflags(Object *ob, | int count_set_pose_transflags(Object *ob, | ||||
| const int mode, | const int mode, | ||||
| const short around, | const short around, | ||||
| bool has_translate_rotate[2]) | bool has_translate_rotate[2], | ||||
| bool clear_mirror_flag) | |||||
| { | { | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bPoseChannel *pchan; | bPoseChannel *pchan; | ||||
| Bone *bone; | Bone *bone; | ||||
| int total = 0; | int total = 0; | ||||
| for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { | for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { | ||||
| bone = pchan->bone; | bone = pchan->bone; | ||||
| /* Clear the MIRROR flag from previous runs. */ | |||||
| if (clear_mirror_flag) { | |||||
| bone->flag &= ~BONE_TRANSFORM_MIRROR; | |||||
| } | |||||
| if (PBONE_VISIBLE(arm, bone)) { | if (PBONE_VISIBLE(arm, bone)) { | ||||
| if ((bone->flag & BONE_SELECTED)) { | if ((bone->flag & BONE_SELECTED)) { | ||||
| bone->flag |= BONE_TRANSFORM; | bone->flag |= BONE_TRANSFORM; | ||||
| } | } | ||||
| else { | else { | ||||
| bone->flag &= ~BONE_TRANSFORM; | bone->flag &= ~BONE_TRANSFORM; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,804 Lines • ▼ Show 20 Lines | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| if ((t->flag & T_AUTOIK) && (t->options & CTX_AUTOCONFIRM)) { | if ((t->flag & T_AUTOIK) && (t->options & CTX_AUTOCONFIRM)) { | ||||
| /* when running transform non-interactively (operator exec), | /* when running transform non-interactively (operator exec), | ||||
| * we need to update the pose otherwise no updates get called during | * we need to update the pose otherwise no updates get called during | ||||
| * transform and the auto-ik is not applied. see [#26164] */ | * transform and the auto-ik is not applied. see [#26164] */ | ||||
| struct Object *pose_ob = tc->poseobj; | struct Object *pose_ob = tc->poseobj; | ||||
| BKE_pose_where_is(t->depsgraph, t->scene, pose_ob); | BKE_pose_where_is(t->depsgraph, t->scene, pose_ob); | ||||
| } | } | ||||
| /* set BONE_TRANSFORM flags for autokey, gizmo draw might have changed them */ | /* Set BONE_TRANSFORM flags for autokey, gizmo draw might have changed them. | ||||
| * (but dont clear BONE_TRANSFORM_MIRROR) */ | |||||
| if (!canceled && (t->mode != TFM_DUMMY)) { | if (!canceled && (t->mode != TFM_DUMMY)) { | ||||
| count_set_pose_transflags(ob, t->mode, t->around, NULL); | count_set_pose_transflags(ob, t->mode, t->around, NULL, false); | ||||
| } | } | ||||
| /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */ | /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */ | ||||
| if (!canceled && t->mode == TFM_TRANSLATION) { | if (!canceled && t->mode == TFM_TRANSLATION) { | ||||
| targetless_ik = apply_targetless_ik(ob); | targetless_ik = apply_targetless_ik(ob); | ||||
| } | } | ||||
| else { | else { | ||||
| /* not forget to clear the auto flag */ | /* not forget to clear the auto flag */ | ||||
| ▲ Show 20 Lines • Show All 543 Lines • Show Last 20 Lines | |||||