Object: minor changes to jump-to API
authorCampbell Barton <ideasman42@gmail.com>
Wed, 21 Nov 2018 02:06:25 +0000 (13:06 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 21 Nov 2018 02:07:36 +0000 (13:07 +1100)
- Always select the jump-to object, even if it's active.
- Remove check for invalid object data
  (these cases will fail much earlier).

source/blender/editors/object/object_select.c

index 5873c972cae2ddd9d8b8ace7f002791325b16bda..1e69916d865e7a8973aa2c27c127244d83c747e9 100644 (file)
@@ -266,7 +266,7 @@ bool ED_object_jump_to_object(
 
        /* TODO, use 'reveal_hidden', as is done with bones. */
 
-       if (view_layer->basact != base) {
+       if (view_layer->basact != base || !(base->flag & BASE_SELECTED)) {
                /* Select if not selected. */
                if (!(base->flag & BASE_SELECTED)) {
                        ED_object_base_deselect_all(view_layer, SEL_DESELECT);
@@ -303,10 +303,6 @@ bool ED_object_jump_to_bone(
 
        bArmature *arm = ob->data;
 
-       if (arm == NULL || GS(arm->id.name) != ID_AR) {
-               return false;
-       }
-
        /* Activate the armature object. */
        if (!ED_object_jump_to_object(C, ob, reveal_hidden)) {
                return false;