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-17 02:34:02 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-10-17 03:10:31 +0300
commit7baa8d2e8f07328fbb187e82f477e56950c25c46 (patch)
tree9d6f44333e348876f04b16fc0f9c59870d80e5ee /source/blender
parent41ad845531b77f14c7836f5d09be50ea8b51c088 (diff)
Multi-Objects: POSE_OT_ik_add + POSE_OT_constraint_add_with_targets
You can now add the target from the non-active armature when they are both in pose mode. There were different ways of going about those operators: * We could create one constraint on each active bone of each object. That wouldn't follow what creating constraints from the UI does though. * We could change the selection/active order and create a constraint for all the selected bones, to the active bone. However this would change the design of changing only the active bone (which also is the one we see in the buttons editor). But in the end I think it makes more sense to let users set a constraint from a charactor to a prop in a handy way. This is pretty much what we had in 2.7x. There we would go for the selected objects, if no selected bone was found in the active object. In 2.8, however, we need this change to make things working as before/intended.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/object/object_constraint.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 0956bd4bf36..982e588b414 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1639,8 +1639,12 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob
/* if the active Object is Armature, and we can search for bones, do so... */
if ((obact->type == OB_ARMATURE) && (only_ob == false)) {
/* search in list of selected Pose-Channels for target */
- CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones)
+ CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob)
{
+ if (ob != obact) {
+ continue;
+ }
+
/* just use the first one that we encounter, as long as it is not the active one */
if (pchan != pchanact) {
*tar_ob = obact;