Partial fix for T60982: Editable anim settings in linked action.
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 29 Jan 2019 20:47:15 +0000 (21:47 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 29 Jan 2019 20:49:46 +0000 (21:49 +0100)
This is only partially working, because some bAnimListElem items do not
have any ID pointer set (for wome mysterious reason...), notably the
'group' ones.

Will re-assign to @aligorith for that, this code is rather complicated
and hard to follow (with all those macros ;) ).

source/blender/editors/animation/anim_channels_defines.c

index c95da49831ac056eb54cdbe219430c0c8fa6ba15..70850781ceded7a308c3318dbb50851ee8b0b7ba 100644 (file)
@@ -4420,6 +4420,12 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, const bAni
                        }
                }
        }
+
+       if ((ale->fcurve_owner_id != NULL && ID_IS_LINKED(ale->fcurve_owner_id)) ||
+           (ale->id != NULL && ID_IS_LINKED(ale->id)))
+       {
+               UI_but_flag_enable(but, UI_BUT_DISABLED);
+       }
 }
 
 /* Draw UI widgets the given channel */