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.
This commit is contained in:
Dalai Felinto 2018-10-16 20:34:02 -03:00
parent 41ad845531
commit 7baa8d2e8f
Notes: blender-bot 2023-02-14 06:00:53 +01:00
Referenced by issue #54650, Multi-Object-Mode: Pose Tools
1 changed files with 5 additions and 1 deletions

View File

@ -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;