Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_generics.c
| Show First 20 Lines • Show All 794 Lines • ▼ Show 20 Lines | static void pose_transform_mirror_update(Object *ob, PoseInitData_Mirror *pid) | ||||
| for (bPoseChannel *pchan_orig = ob->pose->chanbase.first; pchan_orig; | for (bPoseChannel *pchan_orig = ob->pose->chanbase.first; pchan_orig; | ||||
| pchan_orig = pchan_orig->next) { | pchan_orig = pchan_orig->next) { | ||||
| /* no layer check, correct mirror is more important */ | /* no layer check, correct mirror is more important */ | ||||
| if (pchan_orig->bone->flag & BONE_TRANSFORM) { | if (pchan_orig->bone->flag & BONE_TRANSFORM) { | ||||
| bPoseChannel *pchan = BKE_pose_channel_get_mirrored(ob->pose, pchan_orig->name); | bPoseChannel *pchan = BKE_pose_channel_get_mirrored(ob->pose, pchan_orig->name); | ||||
| if (pchan) { | if (pchan) { | ||||
| /* also do bbone scaling */ | |||||
| pchan->bone->xwidth = pchan_orig->bone->xwidth; | |||||
| pchan->bone->zwidth = pchan_orig->bone->zwidth; | |||||
| /* we assume X-axis flipping for now */ | /* we assume X-axis flipping for now */ | ||||
| pchan->curve_in_x = pchan_orig->curve_in_x * -1; | pchan->curve_in_x = pchan_orig->curve_in_x * -1; | ||||
| pchan->curve_out_x = pchan_orig->curve_out_x * -1; | pchan->curve_out_x = pchan_orig->curve_out_x * -1; | ||||
| pchan->roll1 = pchan_orig->roll1 * -1; // XXX? | pchan->roll1 = pchan_orig->roll1 * -1; // XXX? | ||||
| pchan->roll2 = pchan_orig->roll2 * -1; // XXX? | pchan->roll2 = pchan_orig->roll2 * -1; // XXX? | ||||
| float pchan_mtx_final[4][4]; | float pchan_mtx_final[4][4]; | ||||
| BKE_pchan_to_mat4(pchan_orig, pchan_mtx_final); | BKE_pchan_to_mat4(pchan_orig, pchan_mtx_final); | ||||
| ▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | static void recalcData_objects(TransInfo *t) | ||||
| } | } | ||||
| else if (t->flag & T_POSE && (t->mode == TFM_BONESIZE)) { | else if (t->flag & T_POSE && (t->mode == TFM_BONESIZE)) { | ||||
| /* Handle the exception where for TFM_BONESIZE in edit mode we pretend to be | /* Handle the exception where for TFM_BONESIZE in edit mode we pretend to be | ||||
| * in pose mode (to use bone orientation matrix), | * in pose mode (to use bone orientation matrix), | ||||
| * in that case we have to do mirroring as well. */ | * in that case we have to do mirroring as well. */ | ||||
| FOREACH_TRANS_DATA_CONTAINER (t, tc) { | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| Object *ob = tc->poseobj; | Object *ob = tc->poseobj; | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| if (ob->mode == OB_MODE_EDIT) { | |||||
| if (arm->flag & ARM_MIRROR_EDIT) { | if (arm->flag & ARM_MIRROR_EDIT) { | ||||
| if (t->state != TRANS_CANCEL) { | if (t->state != TRANS_CANCEL) { | ||||
| ED_armature_edit_transform_mirror_update(ob); | ED_armature_edit_transform_mirror_update(ob); | ||||
| } | } | ||||
| else { | else { | ||||
| restoreBones(tc); | restoreBones(tc); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else if (ob->mode == OB_MODE_POSE) { | |||||
| /* actually support TFM_BONESIZE in posemode as well */ | |||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | |||||
| bPose *pose = ob->pose; | |||||
| if (arm->flag & ARM_MIRROR_EDIT || pose->flag & POSE_MIRROR_EDIT) { | |||||
| pose_transform_mirror_update(ob, NULL); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| else if (t->flag & T_POSE) { | else if (t->flag & T_POSE) { | ||||
| GSet *motionpath_updates = BLI_gset_ptr_new("motionpath updates"); | GSet *motionpath_updates = BLI_gset_ptr_new("motionpath updates"); | ||||
| FOREACH_TRANS_DATA_CONTAINER (t, tc) { | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| Object *ob = tc->poseobj; | Object *ob = tc->poseobj; | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bPose *pose = ob->pose; | bPose *pose = ob->pose; | ||||
| ▲ Show 20 Lines • Show All 1,515 Lines • Show Last 20 Lines | |||||