[Bf-blender-cvs] [d8a9bcea6ce] master: Fix F-Curve visibility toggle disabled for library overridden rig

Julian Eisel noreply at git.blender.org
Wed Apr 6 18:31:02 CEST 2022


Commit: d8a9bcea6ce5a64f7bac43c0d7e78707b2f64b13
Author: Julian Eisel
Date:   Wed Apr 6 17:06:23 2022 +0200
Branches: master
https://developer.blender.org/rBd8a9bcea6ce5a64f7bac43c0d7e78707b2f64b13

Fix F-Curve visibility toggle disabled for library overridden rig

When showing an action data-block added to a library overridden object
in the Graph Editor, the visibility toggles would be disabled.
Toggling the visibility should be possible still and works with the
shortcuts, just the button was incorrectly disabled.

Also added the usual disabled hint for the tooltip.

Differential Revision: https://developer.blender.org/D14568

Reviewed by: Bastien Montagne

===================================================================

M	source/blender/editors/animation/anim_channels_defines.c

===================================================================

diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index ed0befbcc24..ead189c0389 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -51,6 +51,7 @@
 #include "BKE_curve.h"
 #include "BKE_gpencil.h"
 #include "BKE_key.h"
+#include "BKE_lib_id.h"
 #include "BKE_main.h"
 #include "BKE_nla.h"
 
@@ -5117,11 +5118,11 @@ static void draw_setting_widget(bAnimContext *ac,
           break;
       }
 
-      if ((ale->fcurve_owner_id != NULL &&
-           (ID_IS_LINKED(ale->fcurve_owner_id) || ID_IS_OVERRIDE_LIBRARY(ale->fcurve_owner_id))) ||
-          (ale->id != NULL && (ID_IS_LINKED(ale->id) || ID_IS_OVERRIDE_LIBRARY(ale->id)))) {
+      if ((ale->fcurve_owner_id != NULL && !BKE_id_is_editable(ac->bmain, ale->fcurve_owner_id)) ||
+          (ale->fcurve_owner_id == NULL && ale->id != NULL &&
+           !BKE_id_is_editable(ac->bmain, ale->id))) {
         if (setting != ACHANNEL_SETTING_EXPAND) {
-          UI_but_flag_enable(but, UI_BUT_DISABLED);
+          UI_but_disable(but, TIP_("Can't edit this property from a linked data-block"));
         }
       }
     }



More information about the Bf-blender-cvs mailing list