diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-10 04:52:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-10 04:55:09 +0300 |
commit | 002d0bd344739f6beb76b5f3073def0866d5ad56 (patch) | |
tree | fed8eda4bb4be56f6707232877890974d338caa1 /source/blender/editors/armature | |
parent | b389bb5ef8aedb65313ac61188246461bc03d22a (diff) |
Cleanup: remove unused copy menu code
Unused since 2.4x.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 204 |
1 files changed, 0 insertions, 204 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 4014d7e9728..71eca30e7ee 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -532,210 +532,6 @@ void POSE_OT_paths_range_update(wmOperatorType *ot) } /* ********************************************** */ -#if 0 /* UNUSED 2.5 */ -static void pose_copy_menu(Scene *scene) -{ - Object *obedit = scene->obedit; // XXX context - Object *ob = OBACT; - bArmature *arm; - bPoseChannel *pchan, *pchanact; - short nr = 0; - int i = 0; - - /* paranoia checks */ - if (ELEM(NULL, ob, ob->pose)) return; - if ((ob == obedit) || (ob->mode & OB_MODE_POSE) == 0) return; - - pchan = BKE_pose_channel_active(ob); - - if (pchan == NULL) return; - pchanact = pchan; - arm = ob->data; - - /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changeable, - * but for constraints (just add local constraints) - */ - if (pose_has_protected_selected(ob, 0)) { - i = BLI_listbase_count(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ - if (i < 25) - nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4|Constraints... %x5"); - else - nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4"); - } - else { - i = BLI_listbase_count(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ - if (i < 25) - nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4|Constraints... %x5|%l|Transform Locks %x6|IK Limits %x7|Bone Shape %x8"); - else - nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4|%l|Transform Locks %x6|IK Limits %x7|Bone Shape %x8"); - } - - if (nr <= 0) - return; - - if (nr != 5) { - for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { - if ((arm->layer & pchan->bone->layer) && - (pchan->bone->flag & BONE_SELECTED) && - (pchan != pchanact) ) - { - switch (nr) { - case 1: /* Local Location */ - copy_v3_v3(pchan->loc, pchanact->loc); - break; - case 2: /* Local Rotation */ - copy_qt_qt(pchan->quat, pchanact->quat); - copy_v3_v3(pchan->eul, pchanact->eul); - break; - case 3: /* Local Size */ - copy_v3_v3(pchan->size, pchanact->size); - break; - case 4: /* All Constraints */ - { - ListBase tmp_constraints = {NULL, NULL}; - - /* copy constraints to tmpbase and apply 'local' tags before - * appending to list of constraints for this channel - */ - BKE_constraints_copy(&tmp_constraints, &pchanact->constraints, true); - if ((ob->proxy) && (pchan->bone->layer & arm->layer_protected)) { - bConstraint *con; - - /* add proxy-local tags */ - for (con = tmp_constraints.first; con; con = con->next) - con->flag |= CONSTRAINT_PROXY_LOCAL; - } - BLI_movelisttolist(&pchan->constraints, &tmp_constraints); - - /* update flags (need to add here, not just copy) */ - pchan->constflag |= pchanact->constflag; - - if (ob->pose) - BKE_pose_tag_recalc(bmain, ob->pose); - } - break; - case 6: /* Transform Locks */ - pchan->protectflag = pchanact->protectflag; - break; - case 7: /* IK (DOF) settings */ - { - pchan->ikflag = pchanact->ikflag; - copy_v3_v3(pchan->limitmin, pchanact->limitmin); - copy_v3_v3(pchan->limitmax, pchanact->limitmax); - copy_v3_v3(pchan->stiffness, pchanact->stiffness); - pchan->ikstretch = pchanact->ikstretch; - pchan->ikrotweight = pchanact->ikrotweight; - pchan->iklinweight = pchanact->iklinweight; - } - break; - case 8: /* Custom Bone Shape */ - pchan->custom = pchanact->custom; - if (pchan->custom) { - id_us_plus(&pchan->custom->id); - } - break; - case 9: /* Visual Location */ - BKE_armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc); - break; - case 10: /* Visual Rotation */ - { - float delta_mat[4][4]; - - BKE_armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); - - if (pchan->rotmode == ROT_MODE_AXISANGLE) { - float tmp_quat[4]; - - /* need to convert to quat first (in temp var)... */ - mat4_to_quat(tmp_quat, delta_mat); - quat_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, tmp_quat); - } - else if (pchan->rotmode == ROT_MODE_QUAT) - mat4_to_quat(pchan->quat, delta_mat); - else - mat4_to_eulO(pchan->eul, pchan->rotmode, delta_mat); - } - break; - case 11: /* Visual Size */ - { - float delta_mat[4][4], size[4]; - - BKE_armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); - mat4_to_size(size, delta_mat); - copy_v3_v3(pchan->size, size); - } - } - } - } - } - else { /* constraints, optional (note: max we can have is 24 constraints) */ - bConstraint *con, *con_back; - int const_toggle[24] = {0}; /* XXX, initialize as 0 to quiet errors */ - ListBase const_copy = {NULL, NULL}; - - BLI_duplicatelist(&const_copy, &(pchanact->constraints)); - - /* build the puplist of constraints */ - for (con = pchanact->constraints.first, i = 0; con; con = con->next, i++) { - const_toggle[i] = 1; -// add_numbut(i, UI_BTYPE_TOGGLE|INT, con->name, 0, 0, &(const_toggle[i]), ""); - } - -// if (!do_clever_numbuts("Select Constraints", i, REDRAW)) { -// BLI_freelistN(&const_copy); -// return; -// } - - /* now build a new listbase from the options selected */ - for (i = 0, con = const_copy.first; con; i++) { - /* if not selected, free/remove it from the list */ - if (!const_toggle[i]) { - con_back = con->next; - BLI_freelinkN(&const_copy, con); - con = con_back; - } - else - con = con->next; - } - - /* Copy the temo listbase to the selected posebones */ - for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { - if ((arm->layer & pchan->bone->layer) && - (pchan->bone->flag & BONE_SELECTED) && - (pchan != pchanact) ) - { - ListBase tmp_constraints = {NULL, NULL}; - - /* copy constraints to tmpbase and apply 'local' tags before - * appending to list of constraints for this channel - */ - BKE_constraints_copy(&tmp_constraints, &const_copy, true); - if ((ob->proxy) && (pchan->bone->layer & arm->layer_protected)) { - /* add proxy-local tags */ - for (con = tmp_constraints.first; con; con = con->next) - con->flag |= CONSTRAINT_PROXY_LOCAL; - } - BLI_movelisttolist(&pchan->constraints, &tmp_constraints); - - /* update flags (need to add here, not just copy) */ - pchan->constflag |= pchanact->constflag; - } - } - BLI_freelistN(&const_copy); - BKE_pose_update_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */ - - if (ob->pose) - BKE_pose_tag_recalc(bmain, ob->pose); - } - - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); // and all its relations - - BIF_undo_push("Copy Pose Attributes"); - -} -#endif - -/* ********************************************** */ static int pose_flip_names_exec(bContext *C, wmOperator *op) { |