[Bf-blender-cvs] [09dcb6d60c0] blender2.8: Multi-Object Pose: Fix POSE_OT_group_select and POSE_OT_group_deselect

Joshua Leung noreply at git.blender.org
Mon Apr 30 16:40:57 CEST 2018


Commit: 09dcb6d60c0086e40861264f9a44d9dc131d8e16
Author: Joshua Leung
Date:   Mon Apr 30 16:38:58 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB09dcb6d60c0086e40861264f9a44d9dc131d8e16

Multi-Object Pose: Fix POSE_OT_group_select and POSE_OT_group_deselect

We only want these to operate on the "active" armature only at a time
(where the "active" one is whichever the groups from the UI came from).
The fix therefore is to make it not use the context functions
(which were changed to always take bones from all selected armatures
instead).

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

M	source/blender/editors/armature/pose_group.c

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

diff --git a/source/blender/editors/armature/pose_group.c b/source/blender/editors/armature/pose_group.c
index c9b1d8613a9..aca170a692a 100644
--- a/source/blender/editors/armature/pose_group.c
+++ b/source/blender/editors/armature/pose_group.c
@@ -38,6 +38,7 @@
 #include "DNA_armature_types.h"
 #include "DNA_object_types.h"
 
+#include "BKE_armature.h"
 #include "BKE_action.h"
 #include "BKE_context.h"
 
@@ -432,11 +433,11 @@ void POSE_OT_group_sort(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-static void pose_group_select(bContext *C, Object *ob, bool select)
+static void pose_group_select(Object *ob, bool select)
 {
 	bPose *pose = ob->pose;
 	
-	CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
+	FOREACH_PCHAN_VISIBLE_IN_OBJECT_BEGIN (ob, pchan)
 	{
 		if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0) {
 			if (select) {
@@ -449,7 +450,7 @@ static void pose_group_select(bContext *C, Object *ob, bool select)
 			}
 		}
 	}
-	CTX_DATA_END;
+	FOREACH_PCHAN_VISIBLE_IN_OBJECT_END;
 }
 
 static int pose_group_select_exec(bContext *C, wmOperator *UNUSED(op))
@@ -460,7 +461,7 @@ static int pose_group_select_exec(bContext *C, wmOperator *UNUSED(op))
 	if (ELEM(NULL, ob, ob->pose))
 		return OPERATOR_CANCELLED;
 	
-	pose_group_select(C, ob, 1);
+	pose_group_select(ob, 1);
 	
 	/* notifiers for updates */
 	WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
@@ -491,7 +492,7 @@ static int pose_group_deselect_exec(bContext *C, wmOperator *UNUSED(op))
 	if (ELEM(NULL, ob, ob->pose))
 		return OPERATOR_CANCELLED;
 	
-	pose_group_select(C, ob, 0);
+	pose_group_select(ob, 0);
 	
 	/* notifiers for updates */
 	WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);



More information about the Bf-blender-cvs mailing list