Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-10-19 15:38:21 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-10-19 15:42:43 +0300
commit374a8b9da50bdc3c40cef9394065d5394bb91f33 (patch)
tree5a42aba7dae7442c48143ba35715e401a3183684 /source/blender/editors/armature/pose_select.c
parentc17f2c2eb61f387c278a8dbc8ec559fc1d4bcad6 (diff)
Multi-Objects: Implement/Fix POSE_OT_select_constraint_target
This operator had an initial multi-objects implementation. However it would not select target bones across different selected objects.
Diffstat (limited to 'source/blender/editors/armature/pose_select.c')
-rw-r--r--source/blender/editors/armature/pose_select.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c
index b50c44e6a6b..85b66c9ef46 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -504,9 +504,8 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
{
bConstraint *con;
int found = 0;
- Object *ob_prev = NULL;
- CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob)
+ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
{
if (pchan->bone->flag & BONE_SELECTED) {
for (con = pchan->constraints.first; con; con = con->next) {
@@ -518,16 +517,19 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
cti->get_constraint_targets(con, &targets);
for (ct = targets.first; ct; ct = ct->next) {
- if ((ct->tar == ob) && (ct->subtarget[0])) {
+ Object *ob = ct->tar;
+
+ /* Any armature that is also in pose mode should be selected. */
+ if ((ct->subtarget[0] != '\0') &&
+ (ob != NULL) &&
+ (ob->type == OB_ARMATURE) &&
+ (ob->mode == OB_MODE_POSE))
+ {
bPoseChannel *pchanc = BKE_pose_channel_find_name(ob->pose, ct->subtarget);
if ((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) {
pchanc->bone->flag |= BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL;
+ ED_pose_bone_select_tag_update(ob);
found = 1;
-
- if (ob != ob_prev) {
- ED_pose_bone_select_tag_update(ob);
- ob_prev = ob;
- }
}
}
}