[Bf-blender-cvs] [002d0bd3447] master: Cleanup: remove unused copy menu code

Campbell Barton noreply at git.blender.org
Thu Jan 10 03:02:57 CET 2019


Commit: 002d0bd344739f6beb76b5f3073def0866d5ad56
Author: Campbell Barton
Date:   Thu Jan 10 12:52:20 2019 +1100
Branches: master
https://developer.blender.org/rB002d0bd344739f6beb76b5f3073def0866d5ad56

Cleanup: remove unused copy menu code

Unused since 2.4x.

===================================================================

M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/object/object_edit.c

===================================================================

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
@@ -531,210 +531,6 @@ void POSE_OT_paths_range_update(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* ********************************************** */
-#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)
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 0da8d6804e5..25e3fa848d6 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -125,7 +125,6 @@ static void move_to_collection_menus_items(struct uiLayout *layout, struct MoveT
 /* ************* XXX **************** */
 static void error(const char *UNUSED(arg)) {}
 static void waitcursor(int UNUSED(val)) {}
-static int pupmenu(const char *UNUSED(msg)) { return 0; }
 
 /* port over here */
 static void error_libdata(void) {}
@@ -845,331 +844,6 @@ void OBJECT_OT_posemode_toggle(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* both pointers should exist */
-static void copy_texture_space(Object *to, Object *ob)
-{
-	float *poin1 = NULL, *poin2 = NULL;
-	short texflag = 0;
-
-	if (ob->type == OB_MESH) {
-		texflag = ((Mesh *)ob->data)->texflag;
-		poin2 = ((Mesh *)ob->data)->loc;
-	}
-	else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
-		texflag = ((Curve *)ob->data)->texflag;
-		poin2 = ((Curve *)ob->data)->loc;
-	}
-	else if (ob->type == OB_MBALL) {
-		texflag = ((MetaBall *)ob->data)->texflag;
-		poin2 = ((MetaBall *)ob->data)->loc;
-	}
-	else
-		return;
-
-	if (to->type == OB_MESH) {
-		((Mesh *)to->data)->texflag = texflag;
-		poin1 = ((Mesh *)to->data)->loc;
-	}
-	else if (ELEM(to->type, OB_CURVE, OB_SURF, OB_FONT)) {
-		((Curve *)to->data)->texflag = texflag;
-		poin1 = ((Curve *)to->data)->loc;
-	}
-	else if (to->type == OB_MBALL) {
-		((MetaBall *)to->data)->texflag = texflag;
-		poin1 = ((MetaBall *)to->data)->loc;
-	}
-	else
-		return;
-
-	memcpy(poin1, poin2, 9 * sizeof(float));  /* this was noted in DNA_mesh, curve, mball */
-
-	if (to->type == OB_MESH) {
-		/* pass */
-	}
-	else if (to->type == OB_MBALL) {
-		BKE_mball_texspace_calc(to);
-	}
-	else {
-		BKE_curve_texspace_calc(to->data);
-	}
-
-}
-
-/* UNUSED, keep in case we want to copy functionality for use elsewhere */
-static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, short event)
-{
-	Object *ob;
-	Base *base;
-	Curve *cu, *cu1;
-	Nurb *nu;
-
-	if (ID_IS_LINKED(scene)) return;
-
-	if (!(ob = OBACT(view_layer))) return;
-
-	if (BKE_object_is_in_editmode(ob)) {
-		/* obedit_copymenu(); */
-		return;
-	}
-
-	if (event == 24) {
-		/* moved to BKE_object_link_modifiers */
-		/* copymenu_modifiers(bmain, scene, v3d, ob); */
-		return;
-	}
-
-	for (base = FIRSTBASE(view_lay

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list