Page MenuHome

Fix Outliner editbone selection with 'Sync Selection'
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Nov 5 2020, 2:28 PM.

Details

Summary

When editbones were selected from the Outliner (and they were connected
to a parent) with the 'Sync Selection' option turned ON, they could not
get duplicated.

For duplication to work, the (connected) parent bone's tip also has to
be selected [which was not the case when selection is done from the
Outliner under above circumstances]. The reason for this is not totally
clear to me, but armature_duplicate_selected_exec ->
ED_armature_edit_sync_selection clears the BONE_ROOTSEL flag if the
parent bone's BONE_TIPSEL is not set.

Caused by rB71eb65328078 btw.

The correct "parent-tip-selection" would actually happen in activation

  • tree_element_active_ebone
    • tree_element_active_ebone__sel

but for 'Sync Selection' this happens [also] in

  • outliner_sync_selection_from_outliner
    • outliner_select_sync_to_edit_bone

which did not do the "flushing" to the parent bone's tip

Now use existing dedicated function for this.

ref. T82347

Diff Detail

Repository
rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Nov 5 2020, 2:28 PM

This does solve the problem of not selecting the tip of the parent bone. The tip of the bone is not selected now when synced selection is enabled. There is an exception: only the last bone in a chain is fully selected from the outliner.

I looked into this, but don't have any more time at the moment. I was able to determine that the bones flag is still set to root, tip, and selected after outliner_select_sync_to_edit_bone, so there must be some update triggered by the synced selection that is deselecting the tip connected to a child bone.

I'll try to look more into this later today

Nathan Craddock (natecraddock) requested changes to this revision.Nov 5 2020, 5:36 PM
This revision now requires changes to proceed.Nov 5 2020, 5:36 PM
In D9470#234995, @Zachman wrote:

This does solve the problem of not selecting the tip of the parent bone. The tip of the bone is not selected now when synced selection is enabled. There is an exception: only the last bone in a chain is fully selected from the outliner.

The last bone is not connected (these dont have the "issue")

I looked into this, but don't have any more time at the moment. I was able to determine that the bones flag is still set to root, tip, and selected after outliner_select_sync_to_edit_bone

Yes, but the important part is the parent's TIP (this doesnt seem to be the case -- like I said, outliner_select_sync_to_edit_bone doesnt do the flushing to the parent, unlike tree_element_active_ebone__sel)

so there must be some update triggered by the synced selection that is deselecting the tip connected to a child bone.

Not sure (since the parent's tip hasnt been set to begin with?)

I'll try to look more into this later today

Thx - without this, I wouldnt really know what changes you requested?

Sorry, let me be a little more clear.

I understand this patch to be solving the issue in T82347 where selecting a bone in the outliner does not allow viewport duplication. When I select Bone.002 with this patch applied, the tip of the bone isn't selected.

I also determined the reason why. The synced selection code is deselecting the tip of parent bones when iterating through the bones in the tree. In this example, Bone.003 is deselected in the syncing code, and calling ED_armature_ebone_select_set(ebone, false); is deselecting the parent bone's tip.

source/blender/editors/space_outliner/outliner_sync.c
262

If the parent bone is selected here, we shouldn't deselect it's tip.

Ah, thanx clarifying, will fix.

dont flush to parent for sync selection when bone is deselected (would leave selected bone's tip unselected otherwise)

This revision is now accepted and ready to land.Nov 5 2020, 6:59 PM